From: moodler Date: Sat, 14 Aug 2004 12:15:28 +0000 (+0000) Subject: If the name of an activity is left blank, then give it a generic name X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=71d707f18f329b330be58a984053cf0120f043dd;p=moodle.git If the name of an activity is left blank, then give it a generic name matching the name of the module. --- diff --git a/course/mod.php b/course/mod.php index 15e62854db..527662c8f6 100644 --- a/course/mod.php +++ b/course/mod.php @@ -48,6 +48,11 @@ switch ($mod->mode) { case "update": + + if (trim($mod->name) == '') { + unset($mod->name); + } + $return = $updateinstancefunction($mod); if (!$return) { if (file_exists($moderr)) { @@ -72,6 +77,11 @@ break; case "add": + + if (trim($mod->name) == '') { + $mod->name = get_string("modulename", $mod->modulename); + } + $return = $addinstancefunction($mod); if (!$return) { if (file_exists($moderr)) {