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

The grade_categories hidden field is a smallint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.10.6, 3.11.2
    • Fix Version/s: None
    • Labels:
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE

      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

              Assignee:
              Unassigned Unassigned
              Reporter:
              markn Mark Nelson
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: