From: stronk7 Date: Wed, 4 Feb 2009 17:22:56 +0000 (+0000) Subject: MDL-8848 restore section summaries - now restored if target course have them empty... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=204b15d50b99a2140494f75ecd513b54b387a4db;p=moodle.git MDL-8848 restore section summaries - now restored if target course have them empty ; merged from 19_STABLE --- diff --git a/backup/restorelib.php b/backup/restorelib.php index 53ca90da13..f05e4d2eee 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -1079,6 +1079,11 @@ define('RESTORE_GROUPS_GROUPINGS', 3); //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) {