MDL-61268 core: Fix empty string DB cehck

(amended by stronk7 to use the helper better)
This commit is contained in:
Andrew Nicols 2018-03-02 17:58:21 +08:00 committed by Eloy Lafuente (stronk7)
parent 8b4510c4cc
commit 03d174d733
2 changed files with 2 additions and 1 deletions

View File

@ -511,7 +511,7 @@ function upgrade_fix_block_instance_configuration() {
$sql = "SELECT *
FROM {block_instances}
WHERE configdata <> ''";
WHERE " . $DB->sql_isnotempty('block_instances', 'configdata', true, true);
$blockinstances = $DB->get_recordset_sql($sql);
foreach ($blockinstances as $blockinstance) {
$configdata = base64_decode($blockinstance->configdata);

View File

@ -27,6 +27,7 @@ defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir.'/upgradelib.php');
require_once($CFG->libdir.'/db/upgradelib.php');
/**
* Tests various classes and functions in upgradelib.php library.