From: dwoolhead Date: Tue, 25 Apr 2006 11:48:39 +0000 (+0000) Subject: With appropriate error reporting, adding a label to a section of a course results... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=38943071f018ae67d759ae6dc18bb331babc1c7c;p=moodle.git With appropriate error reporting, adding a label to a section of a course results in an E_NOTICE message temporarily appearing on the screen, because the module object name property is not set. Prevent message being displayed by checking that property is set before testing its value --- diff --git a/course/mod.php b/course/mod.php index d5f7b5376b..2fc900cb4f 100644 --- a/course/mod.php +++ b/course/mod.php @@ -131,7 +131,7 @@ error("This module ($mod->modulename) has been disabled for this particular course"); } - if (trim($mod->name) == '') { + if (!isset($mod->name) || trim($mod->name) == '') { $mod->name = get_string("modulename", $mod->modulename); }