From: stronk7 Date: Thu, 7 May 2009 23:54:46 +0000 (+0000) Subject: MDL-15690, MDL-16518 backup - include roles with overrides (not only with assignments... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b78ed27edb9744a440051ba5947efd0d23b1901b;p=moodle.git MDL-15690, MDL-16518 backup - include roles with overrides (not only with assignments). Merged from 19_STABLE --- diff --git a/backup/backuplib.php b/backup/backuplib.php index a5ce442bba..e3aa6202c7 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -2835,9 +2835,14 @@ } } - // foreach context, call get_roles_on_exact_context insert into array + // foreach context, call get_roles_on_exact_context + get_roles_with_override_on_context() and insert into array foreach ($contexts as $context) { - if ($proles = get_roles_on_exact_context($context)) { + if ($proles = get_roles_on_exact_context($context)) { // Look for roles assignments + foreach ($proles as $prole) { + $roles[$prole->id] = $prole; + } + } + if ($proles = get_roles_with_override_on_context($context)) { // Look for roles overrides foreach ($proles as $prole) { $roles[$prole->id] = $prole; }