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

Template string helper does not render complex language strings

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77003-401
    • Hide

      Repeat steps from MDL-76508

      1. Log in as admin
      2. Navigate to Competencies > Competency frameworks in site administration
      3. Press Add new competency framework
        • Name: My framework
        • ID number: myfr
        • Configure scales
          • Not yet competent: Default
          • Competent: Proficient
      4. Press on My framework in the list
      5. Press Add competency
        • Name: My competency
        • ID number: mycm
      6. Navigate to Profile from user menu
      7. Press Learning plans
      8. Press Add new learning plan
        • Name: My learning plan
      9. Press Add competency
        • Select My competency and press Add
      10. Confirm progress shows "0 out of 1 competencies are proficient"
      11. Under the Learning plan competencies table press Edit > Delete for the competency
      12. Press Confirm
      13. Confirm progress shows "0 out of 0 competencies are proficient"
      Show
      Repeat steps from MDL-76508 Log in as admin Navigate to Competencies > Competency frameworks in site administration Press Add new competency framework Name: My framework ID number: myfr Configure scales Not yet competent: Default Competent: Proficient Press on My framework in the list Press Add competency Name: My competency ID number: mycm Navigate to Profile from user menu Press Learning plans Press Add new learning plan Name: My learning plan Press Add competency Select My competency and press Add Confirm progress shows "0 out of 1 competencies are proficient" Under the Learning plan competencies table press Edit > Delete for the competency Press Confirm Confirm progress shows "0 out of 0 competencies are proficient"

      See screenshot:

      The values "X of Y" are available in the template context, but are not being rendered within the language string when the template is rendered via Javascript (it works fine when rendered server side via PHP)

      Regression appears to be caused by MDL-76508, given we now explicitly check only for {" (curly bracket + double quote), meaning any extra whitespace (as in the plan template) now causes the template to not recognise it as a valid JSON object - in which case we do not pass the correct values to be interpolated into the language string

        1. Screenshot_2023-01-23 My learning plan.png
          Screenshot_2023-01-23 My learning plan.png
          35 kB
        2. master.gif
          master.gif
          272 kB
        3. 401.gif
          401.gif
          380 kB
        4. 400.gif
          400.gif
          367 kB

            pholden Paul Holden
            pholden Paul Holden
            David Herney Bernal David Herney Bernal
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 33 minutes
                1h 33m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.