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

Uses of M.str.{component}.{identifier} should be reviewed and converted to M.util.get_string where possible to avoid needless JS errors from missing strings

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.9
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      In reality, this is pretty irritating to fully test. Behat will cover some of it, but many of the changes are to error strings or exception strings that you will struggle to force through the UI.

      Running behat will be of use, but will not cover everything. Most are trivial changes, but the following areas could do with general testing for string issues:

      1. Availability builder
      2. File picker
      3. File manager
      4. Enrolment

      The things you are looking for are JS errors in the console; and missing strings.

      I also recommend carefully reading each of the changes in the diff. For the most part they consist of replacing:

      M.str.component.identifier
      

      with

      M.util.get_string('identifier', 'component')
      
      Show
      In reality, this is pretty irritating to fully test. Behat will cover some of it, but many of the changes are to error strings or exception strings that you will struggle to force through the UI. Running behat will be of use, but will not cover everything. Most are trivial changes, but the following areas could do with general testing for string issues: Availability builder File picker File manager Enrolment The things you are looking for are JS errors in the console; and missing strings. I also recommend carefully reading each of the changes in the diff. For the most part they consist of replacing: M.str.component.identifier with M.util.get_string('identifier', 'component')
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull Master Branch:
      MDL-28286-master
    • Sprint:
      FRONTEND Sprint 15

      Description

      Just an obvious win - we now have M.util.get_string in javascript-static - it would be nice to use it to avoid any missing string errors.

      Moodle admins - it may be nice to have a couple of new components `JavaScript` and `Page and Output`

      Cheers
      Sam

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/May/15