This is a follow on issue from MDL-39876.
Sam M created a patch that introduced a new method update_course_record that both updated the database and updated $SITE and $COURSE if required.
At the time it was reverted because it caused issues initialising phpunit, installing via CLI, and when editing front page settings.
I think the change still has merits however there are still issues to address.
To change:
- The CLI installation and front page bugs appear to come from trying to update $SITE, they will need to be addressed (3x in lib/adminlib.php)
- The if...elseif in the function should be two ifs (incase $COURSE==$SITE)
- The function should only interact with DB columns (because some idiot developers like to add/remove from records)
- The datatypes in the functions should be thought about, do we need to convert before setting to the globals, mimicking a fetch?
- has been marked as being related by
-
MDL-39876 Change get_record('course') calls to use new get_course API
-
- Closed
-