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

change defaults hardcoded strings in yui or other js notifications to use our get_string method

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.5.2, 2.6.3
    • Fix Version/s: None
    • Component/s: Glossary, JavaScript
    • Labels:
    • Testing Instructions:
      Hide
      • open the JS console
      • for each of the following dialogues, confirm:
        • that the strings are shown without placeholders
          // Setup
          Y.use('moodle-core-notification');
          
          // Confirmation dialogue
          a = new M.core.confirm({});
          // Confirm that the title, yes, and no buttons are correct
          // Confirm that the title on the [X] is correct.
          a.destroy();
          
          // Alert dialogue
          a = new M.core.alert({});
          // Confirm that the title, and OK buttons are correct
          // Confirm that the title on the [X] is correct.
          a.destroy();
          
          // ajax Exception dialogue
          a = new M.core.ajaxException({});
          // Confirm that the title, and default message (Unknonw error) are correct
          // Confirm that the title on the [X] is correct.
          a.destroy();
          
          // standard dialogue
          a = new M.core.dialogue({});
          // Confirm that the title is correct
          // Confirm that the title on the [X] is correct.
          a.destroy();
          
      1. Enable the glossary autolink filter
      2. Open a course and ensure that the glossary autolink is enabled for that course
      3. Create a new glossary with autolinking and an entry with autolinking enabled
      4. Add a label mentioning that entry
      5. Click on the autolink link
        • Confirm that the dialogue opened
        • Confirm that the 'OK' button was shown with the correct string
      Show
      open the JS console for each of the following dialogues, confirm: that the strings are shown without placeholders // Setup Y.use('moodle-core-notification'); // Confirmation dialogue a = new M.core.confirm({}); // Confirm that the title, yes, and no buttons are correct // Confirm that the title on the [X] is correct. a.destroy(); // Alert dialogue a = new M.core.alert({}); // Confirm that the title, and OK buttons are correct // Confirm that the title on the [X] is correct. a.destroy(); // ajax Exception dialogue a = new M.core.ajaxException({}); // Confirm that the title, and default message (Unknonw error) are correct // Confirm that the title on the [X] is correct. a.destroy(); // standard dialogue a = new M.core.dialogue({}); // Confirm that the title is correct // Confirm that the title on the [X] is correct. a.destroy(); Enable the glossary autolink filter Open a course and ensure that the glossary autolink is enabled for that course Create a new glossary with autolinking and an entry with autolinking enabled Add a label mentioning that entry Click on the autolink link Confirm that the dialogue opened Confirm that the 'OK' button was shown with the correct string
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-41808-master

      Description

      In MDLSITE-2493, we patched up glossary filter to alert based on passed in yesLabel string to M.core.alert() however the issue still remains that M.core.alert does not strictly require the string to be passed in and defaults to a hardcoded 'Ok'.

      This issue is about dealing with the hardcoded english defaults in our js yui core as well as pulling the glossary patch into core.

      See lib/yui/src/notification/js/notification.js for other dialogs that we extend which contain hardcoded english strings as default ('Yes', 'No', 'Confirm', 'Are you sure?').

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  nebgor Aparup Banerjee
                  Peer reviewer:
                  Jetha Chan
                  Participants:
                  Component watchers:
                  Adrian Greeve, Mihail Geshoski, Andrew Nicols, Ryan Wyllie
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: