Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57100

lib/amd/src/notification.js is not detecting ajax errors since MDL-56268

    XMLWordPrintable

Details

    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-57103-master
    • Hide

      Generate a realistic fake error:

      diff --git a/lib/external/externallib.php b/lib/external/externallib.php
      index 4de979b..44f809f 100644
      --- a/lib/external/externallib.php
      +++ b/lib/external/externallib.php
      @@ -375,6 +375,7 @@ class core_external extends external_api {
            */
           public static function update_inplace_editable($component, $itemtype, $itemid, $value) {
               global $PAGE;
      +            throw new \moodle_exception('inplaceeditableerror');
               // Validate and normalize parameters.
               $params = self::validate_parameters(self::update_inplace_editable_parameters(),
                             array('component' => $component, 'itemtype' => $itemtype, 'itemid' => $itemid, 'value' => $value));
      
      

      Use inplace editable to edit a section name. Verify you get a JS modal with the exception details. With debugging enabled you should get more details.

      Show
      Generate a realistic fake error: diff --git a/lib/external/externallib.php b/lib/external/externallib.php index 4de979b..44f809f 100644 --- a/lib/external/externallib.php +++ b/lib/external/externallib.php @@ -375,6 +375,7 @@ class core_external extends external_api { */ public static function update_inplace_editable($component, $itemtype, $itemid, $value) { global $PAGE; + throw new \moodle_exception('inplaceeditableerror'); // Validate and normalize parameters. $params = self::validate_parameters(self::update_inplace_editable_parameters(), array('component' => $component, 'itemtype' => $itemtype, 'itemid' => $itemid, 'value' => $value)); Use inplace editable to edit a section name. Verify you get a JS modal with the exception details. With debugging enabled you should get more details.

    Description

      I guess since MDL-56268 was integrated.. i'm getting this JS error:

      Uncaught TypeError: Cannot read property 'substr' of undefined(…)
      

      It looks to be this line:

      lib/amd/src/notification.js:                ex.fileName = '...' + ex.fileName.substr(ex.fileName.length - 20);
      

      Attachments

        Issue Links

          Activity

            People

              damyon Damyon Wiese
              poltawski Dan Poltawski
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Dan Poltawski Dan Poltawski
              Marina Glancy Marina Glancy
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Nov/16