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

Incorrect string formatting/debugging in assignment grader

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-82813-404
    • MDL-82813-405
    • Hide
      1. Log in as admin
        • Make a note of your user ID
      2. Enable web services
      3. Grant yourself a token to user the default mobile service
      4. Create a course
        • Make a note of the course ID
      5. Create a group in the course
        • Embed an image in the Description field
      6. Add yourself (admin) to the new group
      7. Execute the following WS request:

        $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_user_get_course_user_profiles&userlist[0][userid]=<USERID>&userlist[0][courseid]=<COURSEID>" | python -m json.tool
        

      8. Confirm the group description field is correctly formatted (the <img src="..." value contains valid URL)
      9. Confirm there is no debugging in webserver logs
      Show
      Log in as admin Make a note of your user ID Enable web services Grant yourself a token to user the default mobile service Create a course Make a note of the course ID Create a group in the course Embed an image in the Description field Add yourself (admin) to the new group Execute the following WS request: $ curl --silent "<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json" --data "wstoken=<TOKEN>&wsfunction=core_user_get_course_user_profiles&userlist[0][userid]=<USERID>&userlist[0][courseid]=<COURSEID>" | python -m json.tool Confirm the group description field is correctly formatted (the <img src="..." value contains valid URL) Confirm there is no debugging in webserver logs

      See the following from webserver error logs:

      [Fri Aug 16 15:56:10.840666 2024] [php:notice] [pid 9385] [client 192.168.123.1:35432] Debugging: Before calling format_text(), the content must be processed with file_rewrite_pluginfile_urls() in 
      * line 294 of /lib/classes/formatting.php: call to debugging()
      * line 617 of /lib/weblib.php: call to core\\formatting->format_text()
      * line 564 of /user/lib.php: call to format_text()
      * line 2729 of /mod/assign/externallib.php: call to user_get_user_details()
      * line ? of unknownfile: call to mod_assign_external::list_participants()
      * line 253 of /lib/external/classes/external_api.php: call to call_user_func_array()
      * line 83 of /lib/ajax/service.php: call to core_external\\external_api::call_external_function()
      , referer: http://moodle.internal/master/mod/assign/view.php?id=135&action=grading
      

      Seems to come from MDL-77468

      Replication steps:

      1. Enable developer debugging
      2. Create a courseĀ 
      3. Enrol some students
      4. Create a group
      5. Set some text in the group description, setting format to HTML
      6. Edit the description again and add some media (video, image, etc.)
      7. Save the group
      8. Create an assignment (groups mode doesn't need to be set, nor does group submissions)
      9. Click "View all submissions"
      10. Select the group you created earlier from the select
        Expected: No debugging in web server logs
        Actual: Observe the debugging message, as above

            pholden Paul Holden
            pholden Paul Holden
            Stevani Andolo Stevani Andolo
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 26 minutes
                2h 26m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.