From b1a2d9d2af3064cfd03d43ce4166cf4554ee2543 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 7 Dec 2009 06:23:00 +0000 Subject: [PATCH] course MDL-20989 Fixed bug that threw notices if a module didn't support FEATURE_MOD_INTRO --- course/modedit.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/course/modedit.php b/course/modedit.php index ebc5294842..d6d898f083 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -429,10 +429,12 @@ print_error('cannotaddcoursemodule'); } - $introeditor = $fromform->introeditor; - unset($fromform->introeditor); - $fromform->intro = $introeditor['text']; - $fromform->introformat = $introeditor['format']; + if (plugin_supports('mod', $fromform->modulename, FEATURE_MOD_INTRO, false)) { + $introeditor = $fromform->introeditor; + unset($fromform->introeditor); + $fromform->intro = $introeditor['text']; + $fromform->introformat = $introeditor['format']; + } $returnfromfunc = $addinstancefunction($fromform, $mform); -- 2.39.5