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

DML exception when setting grade category "hidden until" field

    XMLWordPrintable

Details

    • Bug
    • Status: Waiting for peer review
    • Major
    • Resolution: Unresolved
    • 3.10.6, 3.11.2, 3.11.5
    • None
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72377-311
    • MDL-72377-400
    • Hide
      1. Log in as admin
      2. Create a course
      3. Navigate to course gradebook setup
        • 311: via Grades link in drawer select Setup tab
        • Master: via Grades tab select Gradebook setup from tertiary navigation
      4. Edit the default course category (Edit > Edit settings)
      5. In the Category total fieldset, press Show more...
      6. Enable the Hidden until field, select a date in the future
      7. Save changes
      8. Confirm the course category is dimmed in gradebook setup (to indicate "hidden"), and no database exception is present
      9. Edit the settings of the course category again
      10. Confirm the Hidden field is ticked and disabled
      11. In the Category total fieldset, press Show more...
      12. Confirm the Hidden until field displays the same value as previously set
      13. Disable Hidden until
      14. Ensure Hidden is still enabled
      15. Save changes
      16. Confirm the course category is dimmed in gradebook setup (to indicate "hidden")
      17. Edit the settings of the course category again
      18. Confirm the Hidden field is ticked and enabled
      19. In the Category total fieldset, press Show more...
      20. Confirm the Hidden until field is not enabled
      Show
      Log in as admin Create a course Navigate to course gradebook setup 311: via Grades link in drawer select Setup tab Master: via Grades tab select Gradebook setup from tertiary navigation Edit the default course category ( Edit > Edit settings ) In the Category total fieldset, press Show more... Enable the Hidden until field, select a date in the future Save changes Confirm the course category is dimmed in gradebook setup (to indicate "hidden"), and no database exception is present Edit the settings of the course category again Confirm the Hidden field is ticked and disabled In the Category total fieldset, press Show more... Confirm the Hidden until field displays the same value as previously set Disable Hidden until Ensure Hidden is still enabled Save changes Confirm the course category is dimmed in gradebook setup (to indicate "hidden") Edit the settings of the course category again Confirm the Hidden field is ticked and enabled In the Category total fieldset, press Show more... Confirm the Hidden until field is not enabled

    Description

      This is a problem because this field can accept timestamps.
       
      Reproduction steps:

      1. Create a course.
      2. Visit the course.
      3. Click on 'Grades' on the left.
      4. Click on the 'Setup' tab.
      5. Edit the category for your course by clicking 'Edit' next to the course name and then 'Edit settings'.
      6. Under 'Category total' click 'Show more...'.
      7. Check the 'Hidden' checkbox.
      8. Set 'Hidden until' to 'Enable'.
      9. Click 'Save changes'.
      10. Re-edit the category.
      11. Under 'Category total' click 'Show more...'.
      12. Notice the 'Hidden until' is disabled.

      So the current problem is the field is just ignored.

      MDL-49202 fixes this so that field is not ignored but then the following error occurs.

      Debug info: ERROR: value "1629360300" is out of range for type smallint
      UPDATE mdl_grade_categories SET courseid = $1,parent = $2,depth = $3,path = $4,fullname = $5,aggregation = $6,keephigh = $7,droplow = $8,aggregateonlygraded = $9,aggregateoutcomes = $10,timecreated = $11,timemodified = $12,hidden = $13 WHERE id=$14
      [array (
      'courseid' => 6,
      'parent' => NULL,
      'depth' => '1',
      'path' => '/5/',
      'fullname' => '?',
      'aggregation' => '13',
      'keephigh' => '0',
      'droplow' => 0,
      'aggregateonlygraded' => '1',
      'aggregateoutcomes' => 0,
      'timecreated' => '1623216974',
      'timemodified' => 1629360308,
      'hidden' => 1629360300,
      0 => 5,
      )]
      Error code: dmlwriteexception
      

       

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              markn Mark Nelson
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 15 minutes
                  1h 15m