mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-31807 fix invalid nulls in cohort components
Credit goes to Stephen.
This commit is contained in:
parent
e356fb68fd
commit
0908a1a327
1 changed files with 3 additions and 2 deletions
|
@ -71,8 +71,9 @@ function cohort_add_cohort($cohort) {
|
||||||
*/
|
*/
|
||||||
function cohort_update_cohort($cohort) {
|
function cohort_update_cohort($cohort) {
|
||||||
global $DB;
|
global $DB;
|
||||||
if (isset($cohort->component) and empty($cohort->component)) {
|
if (property_exists($cohort, 'component') and empty($cohort->component)) {
|
||||||
$cohort->component = NULL;
|
// prevent NULLs
|
||||||
|
$cohort->component = '';
|
||||||
}
|
}
|
||||||
$cohort->timemodified = time();
|
$cohort->timemodified = time();
|
||||||
$DB->update_record('cohort', $cohort);
|
$DB->update_record('cohort', $cohort);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue