Skip to content
Browse files

MDL-22588 restore scales - fix scales not being assigned to target co…

…urse
  • Loading branch information...
1 parent 2688a99 commit 8156571788bec688f101a913b55a24d9f05c31df @stronk7 stronk7 committed May 28, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 backup/restorelib.php
View
4 backup/restorelib.php
@@ -3638,6 +3638,10 @@ function restore_create_scales($restore,$xml_file) {
} else {
$sca->userid = $USER->id;
}
+ // If course scale, recode the course field
+ if ($sca->courseid != 0) {
+ $sca->courseid = $restore->course_id;
+ }
// If scale is standard, if user lacks perms to manage standar scales
// 'downgrade' them to course scales
if ($sca->courseid == 0 and !has_capability('moodle/course:managescales', get_context_instance(CONTEXT_SYSTEM), $sca->userid)) {

0 comments on commit 8156571

Please sign in to comment.
Something went wrong with that request. Please try again.