From b78ed27edb9744a440051ba5947efd0d23b1901b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 7 May 2009 23:54:46 +0000 Subject: [PATCH] MDL-15690, MDL-16518 backup - include roles with overrides (not only with assignments). Merged from 19_STABLE --- backup/backuplib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.39.5