OK, this should finally fix the block upgrading problem.

The problem was that site_admin_menu had not been added to the
database yet when we tried to update the blockinfo for the site.
This commit is contained in:
moodler
2004-08-30 15:57:09 +00:00
parent 327f0cdf22
commit 4e65d23fd1
3 changed files with 5 additions and 14 deletions
-7
View File
@@ -37,13 +37,6 @@ global $CFG;
COMMENT = 'To register and update all the available blocks'");
}
if (!empty($CFG->siteblocksadded)) { /// Set by main Moodle upgrade
// Add blockinfo to the site course
require_once($CFG->dirroot.'/lib/blocklib.php');
$site = get_site();
blocks_get_default_blocks($site->id, BLOCKS_DEFAULT_SITE);
delete_records('config', 'name', 'siteblocksadded');
}
//Finally, return result
return $result;
-7
View File
@@ -39,13 +39,6 @@ global $CFG;
}
if (!empty($CFG->siteblocksadded)) { /// Set by main Moodle upgrade
// Add blockinfo to the site course
require_once($CFG->dirroot.'/lib/blocklib.php');
$site = get_site();
blocks_get_default_blocks($site->id, BLOCKS_DEFAULT_SITE);
delete_records('config', 'name', 'siteblocksadded');
}
//Finally, return result
return $result;
+5
View File
@@ -705,6 +705,11 @@ function upgrade_blocks_plugins($continueto) {
}
}
if (!empty($CFG->siteblocksadded)) { /// This is a once-off hack to make a proper upgrade
blocks_get_default_blocks(SITEID, BLOCKS_DEFAULT_SITE); // Add blockinfo to the site course
delete_records('config', 'name', 'siteblocksadded');
}
if (!empty($updated_blocks)) {
print_continue($continueto);
die;