Skip to content

Commit

Permalink
MDL-8848 restore section summaries - now restored if target course ha…
Browse files Browse the repository at this point in the history
…ve them empty ; merged from 19_STABLE
  • Loading branch information
stronk7 committed Feb 4, 2009
1 parent 522f26f commit 204b15d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,11 @@ function restore_create_sections(&$restore, $xml_file) {
//Get section id when restoring in existing course
$rec = $DB->get_record("course_sections", array("course"=>$restore->course_id,
"section"=>$section->section));
//If section exists, has empty summary and backup has some summary, use it. MDL-8848
if ($rec && empty($rec->summary) && !empty($section->summary)) {
$rec->summary = $section->summary;
$DB->update_record("course_sections", $rec);
}
//If that section doesn't exist, get section 0 (every mod will be
//asigned there
if(!$rec) {
Expand Down

0 comments on commit 204b15d

Please sign in to comment.