]> git.mjollnir.org Git - moodle.git/commitdiff
course MDL-20989 Fixed bug that threw notices if a module didn't support FEATURE_MOD_...
authorSam Hemelryk <sam@moodle.com>
Mon, 7 Dec 2009 06:23:00 +0000 (06:23 +0000)
committerSam Hemelryk <sam@moodle.com>
Mon, 7 Dec 2009 06:23:00 +0000 (06:23 +0000)
course/modedit.php

index ebc5294842d1512273e39f699d0e9cc34a7407be..d6d898f08307f389b9ebd02331ddefe1a8c63daf 100644 (file)
                 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);