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

This commit is contained in:
dwoolhead 2006-04-25 11:48:39 +00:00
parent 206548dc4b
commit 38943071f0

View File

@ -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);
}