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

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57103-master

      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

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Nov/16