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

moodle-core-notification-exception does not display some properties

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.6.4, 2.7.1
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide
      1. Open /lib/javascript-static.js, scroll to the bottom and paste in:
        Moodle 2.6/2.7:

          YUI().use('moodle-core-notification-exception', function(Y) {
              try {
                  Y.JSON.parse('broken content');
              } catch (error) {
                  new M.core.exception(error);
              }
          });
        

        Moodle 2.5:

          YUI().use('moodle-core-notification', function(Y) {
              try {
                  Y.JSON.parse('broken content');
              } catch (error) {
                  new M.core.exception(error);
              }
          });
        

      1. Visit any page in Moodle
        • Confirm that the dialogue has the following attributes displayed:
          1. title (in the title bar)
          2. a message (just below it)
            Note: Some browsers will also show:
      • a stack trace
      • a line number
        (this is because browsers decide to add things which are not mentioned in the spec - yay consistency)
      1. make sure behat passes on ci
      Show
      Open /lib/javascript-static.js, scroll to the bottom and paste in: Moodle 2.6/2.7: YUI().use('moodle-core-notification-exception', function(Y) { try { Y.JSON.parse('broken content'); } catch (error) { new M.core.exception(error); } }); Moodle 2.5: YUI().use('moodle-core-notification', function(Y) { try { Y.JSON.parse('broken content'); } catch (error) { new M.core.exception(error); } }); Visit any page in Moodle Confirm that the dialogue has the following attributes displayed: title (in the title bar) a message (just below it) Note: Some browsers will also show: a stack trace a line number (this is because browsers decide to add things which are not mentioned in the spec - yay consistency) make sure behat passes on ci
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-45472-master

      Description

      When we pass the exception dialogue an actual exception, most of the properties are prototypal, so Y.Attribute filters them out and does not set them.

      We need to whitelist them. Discovered by Frédéric Massart

        Attachments

          Activity

            People

            Assignee:
            dobedobedoh Andrew Nicols
            Reporter:
            dobedobedoh Andrew Nicols
            Peer reviewer:
            Frédéric Massart
            Integrator:
            Damyon Wiese
            Tester:
            Jason Fowler
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Jul/14