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

block_timeline: Syntax Error: JSON.parse: bad escaped character

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.7, 3.8.3, 3.9, 3.10
    • Fix Version/s: None
    • Component/s: Blocks, Dashboard (My home)
    • Labels:
    • Testing Instructions:
      Hide

      $release = '3.9dev+ (Build: 20200527)';

      1. Create a course.
      2. Enrol a student.
      3. Create a group with name: "MyGroup\Has\BackSlash - Name"
      4. Add the student onto that group.
      5. Go back to the course content page, and turn editing on.
      6. Add an assignment activity, use default settings value and save it.
      7. Go to the assignment activity page, and add Group Override.
      8. Add an override for the group "MyGroup\Has\BackSlash - Name" and set Due date to tomorrow (or future within 7 days).
      9. Log in as the student and go to your Dashboard.
      10. In the Timeline block, click the "Clock" icon and select "All".
        Result: You will receive a pop-up dialogue:
        JSON.parse: bad escaped character at line 1 column 26 of the JSON data
        File: http://localhost/moodlevanilla/lib/requirejs.php/1590533771/core/first.js
      Show
      $release = '3.9dev+ (Build: 20200527)'; Create a course. Enrol a student. Create a group with name: "MyGroup\Has\BackSlash - Name" Add the student onto that group. Go back to the course content page, and turn editing on. Add an assignment activity, use default settings value and save it. Go to the assignment activity page, and add Group Override. Add an override for the group "MyGroup\Has\BackSlash - Name" and set Due date to tomorrow (or future within 7 days). Log in as the student and go to your Dashboard. In the Timeline block, click the "Clock" icon and select "All". Result: You will receive a pop-up dialogue: JSON.parse: bad escaped character at line 1 column 26 of the JSON data File: http://localhost/moodlevanilla/lib/requirejs.php/1590533771/core/first.js
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

       A pop-up error appears when student logs in and visits dashboard. The error displayed is:

      Syntax Error

      JSON.parse: bad escaped character at line 1 column 26 of the JSON data.

       

      This happens when a student is a member of a group with "\" characters and an activity with due date has a group override for that group.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jebarvia Joshua Ebarvia
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: