From 3724d12ab49177be49e6b2e66ea3349c14cf1c12 Mon Sep 17 00:00:00 2001 From: Donald Barrett Date: Wed, 16 Nov 2016 22:08:59 +1300 Subject: [PATCH] MDL-56301 course: Use value for intro field if set in a mods function Respects a module that has set a value for the db field intro in it's lib function modulename_add_instance. --- course/modlib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/course/modlib.php b/course/modlib.php index ab0c7a6c091..74e0c27a173 100644 --- a/course/modlib.php +++ b/course/modlib.php @@ -145,6 +145,9 @@ function add_moduleinfo($moduleinfo, $course, $mform = null) { // Update embedded links and save files. $modcontext = context_module::instance($moduleinfo->coursemodule); if (!empty($introeditor)) { + // This will respect a module that has set a value for intro in it's modname_add_instance() function. + $introeditor['text'] = $moduleinfo->intro; + $moduleinfo->intro = file_save_draft_area_files($introeditor['itemid'], $modcontext->id, 'mod_'.$moduleinfo->modulename, 'intro', 0, array('subdirs'=>true), $introeditor['text']);