-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.7.3, 3.8, 3.9.3, 3.11.8, 4.0.2, 4.1
-
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.
- duplicates
-
MDL-68724 O bloco Linha do Tempo está gerando erro no painel quando atividades contém caractere TAB / block_timeline can cause JSON parse error on dashboard when activities are saved with TAB character
-
- Closed
-
- has been marked as being related by
-
MDL-66131 block_timeline causes JSON parse error when activity name contains quotes
-
- Closed
-
-
MDL-68865 block_timeline: Syntax Error: JSON.parse: bad escaped character
-
- Closed
-
- is duplicated by
-
MDL-75491 Timeline block throws JSON error when course full name contains a backspace
-
- Closed
-
- will be (partly) resolved by
-
MDL-66131 block_timeline causes JSON parse error when activity name contains quotes
-
- Closed
-
-
MDL-66820 Double escaped quotes in timeline block
-
- Closed
-
-
MDL-75516 Mustache quote helper does not escape all special JSON characters
-
- Closed
-