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

Course names containing "\" symbol causing JSON error in block_timeline

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • 2

      Found in Moodle 3.7 and confirmed on qa.moodledemo.net, the following issue:

      When a course fullname and/or shortname contain a "\", a SyntaxError for the block_timeline JSON occurs, causing the loading of the Timeline block content to fail.

      The error:

      SyntaxError: Unexpected token d in JSON at position 76
      {{ at JSON.parse (<anonymous>)}}
      {{ at z.stringHelper (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:44:3408)}}
      {{ at z.<anonymous> (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:44:4319)}}
      {{ at n.renderSection (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:5436)}}
      {{ at n.renderTokens (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:4623)}}
      {{ at n.renderPartial (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:6014)}}
      {{ at n.renderTokens (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:4716)}}
      {{ at n.renderSection (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:5165)}}
      {{ at n.renderTokens (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:4623)}}
      {{ at n.renderPartial (https://qa.moodledemo.net/lib/requirejs.php/1578488895/core/first.js:16:6014)}}

      To reproduce:

      • Create a course (or modify the course fullname) so it contains a "\".
      • Add an activity with a deadline for submitting or grading
      • Make sure the Timeline block is on the Dashboard page
      • Access the Dashboard page and wait for the Timeline block to load
      • The SyntaxError popup will appear.
      • Remove the "\" from the course's name, and replace with another symbol (space, -)
      • Recheck the Dashboard > Timeline block to confirm the problem now does not occur.

      Edit: As reported in 68724. the same error comes up when using a TAB character.

            Unassigned Unassigned
            jwelshoff Joost Elshoff
            Votes:
            9 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

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