-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
4.1
-
None
-
MOODLE_401_STABLE
If a course have exactly the fist character { and is not followed by an other {, the block course_summary will not be able to render, showing the error:
SyntaxError:
Unexpected token M in JSON at position 1.
The M is the following character on the course name
The the following examples course names
{My}first course -> This will brake the block
{\{My}first course -> This will works fine
My first course -> This will works fine
To replicate:
Login in the Moodle Sandbox Instance as admin
Acess the course My first course
Edit the course name to {My} first course
Go to Participants
Enrol the admin user as a student
Access the My Courses tab
For now I edit the file course/externallib.php and added the following snippet at line 3854. Dirty, but I needed to get it working, and I am not comfortable with the Moodle's JS yet.
foreach($filteredcourses as $key => $value){
|
$filteredcourses[$key]->fullname = str_replace(['{{', '{', '}}', '}'], '', $value->fullname); |
}
|
- duplicates
-
MDL-76508 Syntax error block Course Overview when { is being used in the course name
-
- Closed
-