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

Timeline block has problems with backslashes in full names of courses and activities.

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.13
    • None
    • Blocks
    • None
    • MOODLE_39_STABLE

    Description

      There is an error in Timeline block when it tries to show a planned event if the course full name or the activity full name contain a backslash '\'.

      Examples:
      'Backslash \ chat name'
      'Backslash \ course name'

      When there is a backslash in the course name.
      SyntaxError: Unexpected token   in JSON at position 53
          at JSON.parse (<anonymous>)
          at Renderer.stringHelper (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:362:6773)
          at Renderer.<anonymous> (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:362:8141)
          at Writer.renderSection (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:8035)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6836)
          at Writer.renderPartial (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:9198)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6995)
          at Writer.renderSection (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:7634)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6836)
          at Writer.renderPartial (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:9198)

      When there is a backslash in the chat name.
      SyntaxError: Unexpected token   in JSON at position 22
          at JSON.parse (<anonymous>)
          at Renderer.stringHelper (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:362:6773)
          at Renderer.<anonymous> (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:362:8141)
          at Writer.renderSection (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:8035)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6836)
          at Writer.renderPartial (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:9198)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6995)
          at Writer.renderSection (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:7634)
          at Writer.renderTokens (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:6836)
          at Writer.renderPartial (https://communitymoodle39.p72.demo3.opentechnology.ru/lib/requirejs.php/1647854186/core/first.js:529:9198)

      Steps:

      (course case)

      1. Create a user.
      2. Make sure there is a visible timeline block in the user dashboard.
      3. Create a course with a backslash in its name (Backslash \ course name).
      4. Enrol the user on the course.
      5. Create a chat with no backslashes in its name in the course (Regular chat name).
      6. In the chat instance settings in "Chat session" section set "Next chat time" to tomorrow or the day after tomorrow.
      7. In the chat instance settings in "Chat session" section set "Repeat/publish session times" to "At the same time every week".
      8. Login as the user and navigate to the dashboard.
      9. Wait a little for AJAX requests to execute and the error to appear in modal.

      (chat case)

      1. Create a user.
      2. Make sure there is a visible timeline block in the user dashboard.
      3. Create a course with no backslashes in its name (Regular course name).
      4. Enrol the user on the course.
      5. Create a chat with a backslash in its name in the course (Backslash \ chat name).
      6. In the chat instance settings in "Chat session" section set "Next chat time" to tomorrow or the day after tomorrow.
      7. In the chat instance settings in "Chat session" section set "Repeat/publish session times" to "At the same time every week".
      8. Login as the user and navigate to the dashboard.
      9. Wait a little for AJAX requests to execute and the error to appear in modal.

      Seems related to https://tracker.moodle.org/browse/MDL-67640

      Attachments

        1. Backslash chat name.png
          Backslash chat name.png
          171 kB
        2. Backslash course name.png
          Backslash course name.png
          185 kB
        3. The chat.png
          The chat.png
          134 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              андрейусков Андрей Усков
              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: