From: stronk7 Date: Fri, 29 Feb 2008 19:55:06 +0000 (+0000) Subject: rebuild_course_cache() to calculate modinfo before role assignments. MDL-13740 ;... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e28de1f5cca1d32fed02cd775b2926341066183c;p=moodle.git rebuild_course_cache() to calculate modinfo before role assignments. MDL-13740 ; merged from 19_STABLE --- diff --git a/backup/restorelib.php b/backup/restorelib.php index a7470fe824..734bc07f5d 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -4139,6 +4139,8 @@ define('RESTORE_GROUPS_GROUPINGS', 3); $status = false; } } + /// Finally, calculate modinfo cache. + rebuild_course_cache($restore->course_id); } @@ -7517,6 +7519,8 @@ define('RESTORE_GROUPS_GROUPINGS', 3); } //Now, if all is OK, adjust the instance field in course_modules !! + //this also calculates the final modinfo information so, after this, + //code needing it can be used (like role_assignments. MDL-13740) if ($status) { if (!defined('RESTORE_SILENTLY')) { echo "
  • ".get_string("checkinginstances"); @@ -7641,8 +7645,6 @@ define('RESTORE_GROUPS_GROUPINGS', 3); if (!defined('RESTORE_SILENTLY')) { echo "
  • ".get_string("checkingcourse"); } - //modinfo field - rebuild_course_cache($restore->course_id); //categories table $course = get_record("course","id",$restore->course_id); fix_course_sortorder();