Commit 61e272c7 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Gerrit Code Review
Browse files

Merge "Bug 1788710: Altering db upgrade step to avoid unrelated 'tags' error"

parents aebe9e61 a6c082d3
......@@ -881,19 +881,20 @@ function xmldb_core_upgrade($oldversion=0) {
foreach ($instances as $instance) {
$blockinstance = new BlockInstance($instance->id);
$configdata = $blockinstance->get('configdata');
// We don't want to do the normal commit() here as plan blocks have associated artefacts
// and this can clash with the 'artefact_tag' to 'tag' change
// As we have not changed which artefacts are attached but only how the configdata is stored
// we will save the new configdata back direct to database instead.
if (isset($configdata['artefactid'])) {
$configdata['artefactids'] = array($configdata['artefactid']);
unset($configdata['artefactid']);
$blockinstance->set('configdata', $configdata);
$blockinstance->commit();
}
else if (is_null($configdata['artefactid'])) {
$configdata['artefactids'] = array();
unset($configdata['artefactid']);
$blockinstance->set('configdata', $configdata);
$blockinstance->commit();
}
$configdata = serialize($configdata);
execute_sql("UPDATE {block_instance} SET configdata = ? WHERE id = ?", array($configdata, $instance->id));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment