From abbda1f869d1a9c534b0fc8050cf66ae4ac895dc Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 8 Feb 2013 12:40:49 +0000 Subject: [PATCH] MDL-37943 upgrade: logic error in upgrade_plugins_blocks. Derek Woolhead tracked down the problem and what needed to be fixed. I just made the patch. The problem was that if $plugin->cron had changed in version.php, then the version number in the database could end up wrong after the upgrade, and so the upgrade would immediately run a second time. --- lib/upgradelib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/upgradelib.php b/lib/upgradelib.php index cde67d94dfa..568d367ca12 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -821,8 +821,7 @@ function upgrade_plugins_blocks($startcallback, $endcallback, $verbose) { if ($currblock->cron != $block->cron) { // update cron flag if needed - $currblock->cron = $block->cron; - $DB->update_record('block', $currblock); + $DB->set_field('block', 'cron', $block->cron, array('id' => $currblock->id)); } // Upgrade various components