Skip to content

Commit

Permalink
MDL-67054 upgrade: prevent potential PHP notice
Browse files Browse the repository at this point in the history
In some sites $CFG->requestcategoryselection may be not defined.

So this just wraps the use within empty, keeping the spirit intact,
aka, invert whatever the precious setting was storing.

null, 0, false, '0' => 1
1, true, '1' => 0
  • Loading branch information
stronk7 committed Oct 29, 2019
1 parent d769970 commit 2567644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db/upgrade.php
Expand Up @@ -3614,7 +3614,7 @@ function xmldb_main_upgrade($oldversion) {
if ($oldversion < 2019101600.01) {

// Change the setting $CFG->requestcategoryselection into $CFG->lockrequestcategory with opposite value.
set_config('lockrequestcategory', !$CFG->requestcategoryselection);
set_config('lockrequestcategory', empty($CFG->requestcategoryselection));

upgrade_main_savepoint(true, 2019101600.01);
}
Expand Down

0 comments on commit 2567644

Please sign in to comment.