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

Calling graphlib->draw_brush results in unrendered image and error-message.

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-79215-MOODLE_403_STABLE
    • MDL-79215-MOODLE_404_STABLE
    • MDL-79215-main
    • Hide

      Testing this fix is a little tricky as there is no graph in core Moodle that uses a line type = brush. We initially found this issue when using adaptivequiz plugin. Here is the testing instruction but we are open to providing another way if required (e.g.: Script to simulate the graph or an example of a plugin that displays a graph with the issue).

      1. Log in as admin.
      2. main and 404 - You need to enable the Survey activity in Site admin > Plugins > Manage activities
      3. Create a course.
      4. Create a survey in the course. The "COLLES (Actual)" survey type should be okay for this issue.
      5. On a different browser session, log in as a student enrolled in the course and complete the survey.
      6. Download and apply the first test patch 0001-MDL-79215-TEST-1.patch to your Moodle instance.

        git am -3 path/to/0001-MDL-79215-TEST-1.patch
        

      7. Back on the admin's browser window, navigate to the survey's Response reports page.
      8. Confirm that the graph is rendered and you don't encounter any errors.
      9. Reset your instance so that the first test patch gets dropped.
      10. Download and apply the second test patch 0002-MDL-79215-TEST-2.patch

        git am -3 path/to/0002-MDL-79215-TEST-2.patch
        

      11. Confirm that the graph is rendered and you don't encounter any errors.
      Show
      Testing this fix is a little tricky as there is no graph in core Moodle that uses a line type = brush . We initially found this issue when using adaptivequiz plugin. Here is the testing instruction but we are open to providing another way if required (e.g.: Script to simulate the graph or an example of a plugin that displays a graph with the issue). Log in as admin. main and 404 - You need to enable the Survey activity in Site admin > Plugins > Manage activities Create a course. Create a survey in the course. The " COLLES (Actual) " survey type should be okay for this issue. On a different browser session, log in as a student enrolled in the course and complete the survey. Download and apply the first test patch 0001-MDL-79215-TEST-1.patch to your Moodle instance. git am -3 path /to/0001-MDL-79215-TEST-1 .patch Back on the admin's browser window, navigate to the survey's Response reports page. Confirm that the graph is rendered and you don't encounter any errors. Reset your instance so that the first test patch gets dropped. Download and apply the second test patch 0002-MDL-79215-TEST-2.patch git am -3 path /to/0002-MDL-79215-TEST-2 .patch Confirm that the graph is rendered and you don't encounter any errors.

      lib/graphlib.php is using the php round() function to calculate some parameters that then get passed to gd-functions like ImageArc or ImageFillToBorder.
      This gives an error as the round() function is returning float-typed values while gd is expecting int-typed values.
      Other functions in the graphlib do already use type-casting to prevent this.
      The function draw_brush does not do that.

        1. 0001-MDL-79215-TEST-1.patch
          1.0 kB
        2. 0002-MDL-79215-TEST-2.patch
          0.7 kB
        3. MDL-79215-403-11.png
          MDL-79215-403-11.png
          16 kB
        4. MDL-79215-403-8.png
          MDL-79215-403-8.png
          16 kB
        5. MDL-79215-404-11.png
          MDL-79215-404-11.png
          15 kB
        6. MDL-79215-404-8.png
          MDL-79215-404-8.png
          15 kB
        7. MDL-79215-main-11.png
          MDL-79215-main-11.png
          16 kB
        8. MDL-79215-main-8.png
          MDL-79215-main-8.png
          21 kB

            michaelreyes Karl Michael Reyes
            phreaknerd Carsten Nielsen
            Daniel Ziegenberg Daniel Ziegenberg
            Jun Pataleta Jun Pataleta
            Kevin Percy Kevin Percy
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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