Moodle

grade_category-->keephigh seems to be lost after executing apply_forced_settings (causes Oracle breakage)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.1
  • Labels:
    None
  • Database:
    Oracle
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

While playing with Oracle I get:

ORA-01407: cannot update ("STRONK7_19"."M_GRADE_CATEGORIES"."KEEPHIGH") to NULL

UPDATE m_grade_categories SET courseid = '21',parent = NULL,depth = '1',path = '/4/',fullname = '?',aggregation = '11',keephigh = '',droplow = '0',aggregateonlygraded = '1',aggregateoutcomes = '1',aggregatesubcats = '1',timecreated = '1206208578',timemodified = '1206231472' WHERE id = 4

  • line 1704 of lib/dmllib.php: call to debugging()
  • line 205 of lib/grade/grade_object.php: call to update_record()
  • line 222 of lib/grade/grade_category.php: call to grade_object->update()
  • line 877 of lib/grade/grade_category.php: call to grade_category->update()
  • line 784 of lib/grade/grade_category.php: call to grade_category->get_children()
  • line 1299 of grade/lib.php: call to grade_category->fetch_course_tree()
  • line 122 of grade/report/grader/lib.php: call to grade_tree->grade_tree()
  • line 122 of grade/report/grader/index.php: call to grade_report_grader->grade_report_grader()

Problem seems to be the "keephigh" field whose value, when inserted, is '' (empty string). Tracing the problem down, I've found that the grade_category->apply_forced_settings() call changes the previous value of "keephigh" from 0 to empty string and is the final cause for breakage.

Code in apply_forced_settings() seems to rely on $CFG->grade_keephigh, that, in my server is empty string.

To reproduce, I just installed 1.9 under Oracle, created one course and press in the gradebook. Then the error above happened (and some sort of infinite recursion killing the web server).

Ciao

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

there should be integer in that config variable, how is it possible that you have null there?

Show
Petr Škoda (skodak) added a comment - there should be integer in that config variable, how is it possible that you have null there?
Hide
Eloy Lafuente (stronk7) added a comment -

Root cause of this problem was MDL-14182, where '0' strings were sent to database as ' ' (whitespace). Only affected Oracle and it is fixed now.

Resolved. Ciao

P.S.: Affected sites can auto-fix it by accessing to the corresponding admin settings page and saving it. That will update config records with a correct 0.

Show
Eloy Lafuente (stronk7) added a comment - Root cause of this problem was MDL-14182, where '0' strings were sent to database as ' ' (whitespace). Only affected Oracle and it is fixed now. Resolved. Ciao P.S.: Affected sites can auto-fix it by accessing to the corresponding admin settings page and saving it. That will update config records with a correct 0.

People

Dates

  • Created:
    Updated:
    Resolved: