Skip to content

Commit

Permalink
MDL-37078: Restore - section restore fails with multiple availability…
Browse files Browse the repository at this point in the history
… conditions
  • Loading branch information
sammarshallou committed Dec 12, 2012
1 parent 4bd6f71 commit 79e9e60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backup/moodle2/restore_stepslib.php
Expand Up @@ -1259,11 +1259,11 @@ public function after_restore() {
$sectionid = $this->get_task()->get_sectionid();

// Get data object for current section availability (if any).
$data = $DB->get_record('course_sections_availability',
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid', IGNORE_MISSING);
$records = $DB->get_records('course_sections_availability',
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid');

// If it exists, update mappings.
if ($data) {
foreach ($records as $data) {
// Only update mappings for entries which are created by this restore.
// Otherwise, when you restore to an existing course, it will mess up
// existing section availability entries.
Expand Down
2 changes: 1 addition & 1 deletion lib/conditionlib.php
Expand Up @@ -942,7 +942,7 @@ public function is_available(&$information, $grabthelot=false, $userid=0, $modin
if (empty($modinfo->cms[$cmid])) {
global $PAGE;
if (isset($PAGE) && strpos($PAGE->pagetype, 'course-view-')===0) {
debugging("Warning: activity {$this->cm->id} '{$this->cm->name}' has condition " .
debugging("Warning: activity {$this->item->id} '{$this->item->name}' has condition " .
"on deleted activity $cmid (to get rid of this message, edit the named activity)");
}
continue;
Expand Down

0 comments on commit 79e9e60

Please sign in to comment.