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:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user