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

Timeline block throws JSON error when course full name contains a backspace

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.11.8, 4.0.2
    • None
    • Dashboard (My home)
    • None
    • MOODLE_311_STABLE, MOODLE_400_STABLE

    Description

      Scenario:

      1. Login as admin, turn debugging on (DEVELOPER level + Display debug messages),
      2. Create a course with a backslash \ character included in its full / long name.
      3. Add an activity with a due date (e.g. Assignment).
      4. Enrol Student A.
      5. Log in as Student A.
      6. Visit the Dashboard/Timeline page (Moodle 4) or the Dashboard page containing the Timeline block (Moodle 3).
      7. Instead of properly loading, Moodle will show a modal with an alert like this:

      JSON.parse: bad escaped character at line 1 column 146 of the JSON data
      File: https://YOUR_MOODLE_URL/lib/requirejs.php/1660337173/core/first.js
      Line: 17
      Stack trace:

      ln: 6772
      https://YOUR_MOODLE_URL/lib/requirejs.php
      Renderer.prototype.stringHelper

      ln: 7005
      https://YOUR_MOODLE_URL/lib/requirejs.php
      Renderer.prototype.cleanStringHelper

      ln: 8305
      https://YOUR_MOODLE_URL/lib/requirejs.php
      Renderer.prototype.addHelperFunction/</<

      ln: 8035
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderSection

      ln: 6836
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderTokens

      ln: 9198
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderPartial

      ln: 6995
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderTokens

      ln: 7634
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderSection

      ln: 6836
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderTokens

      ln: 9198
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderPartial

      ln: 6995
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderTokens

      ln: 7634
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderSection

      ln: 6836
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.renderTokens

      ln: 6556
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/Writer.prototype.render

      ln: 10893
      https://YOUR_MOODLE_URL/lib/requirejs.php
      factory/mustache.render

      ln: 10546
      https://YOUR_MOODLE_URL/lib/requirejs.php
      Renderer.prototype.doRender/<

      ln: 30005
      https://YOUR_MOODLE_URL/lib/javascript.ph
      e

      ln: 30307
      https://YOUR_MOODLE_URL/lib/javascript.ph
      Deferred/then/l/</t<

       

      Also checked: Calendar, My courses page (M4) + Dashboard/Course overview (M3), Recently accessed courses block, Upcoming activities course block - no issues there.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pmk Przemek Kaszubski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: