From f75507dadbaabe2df698ff522e120d6f64113c88 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 4 Feb 2009 17:24:08 +0000 Subject: [PATCH] MDL-8848 restore section summaries - now restored if target course have them empty ; backported from 19_STABLE --- backup/restorelib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backup/restorelib.php b/backup/restorelib.php index 0b73aa4ceca..47ed8c821e6 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -974,6 +974,11 @@ //Get section id when restoring in existing course $rec = get_record("course_sections","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; + update_record("course_sections", $rec); + } //If that section doesn't exist, get section 0 (every mod will be //asigned there if(!$rec) {