From 71d707f18f329b330be58a984053cf0120f043dd Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 14 Aug 2004 12:15:28 +0000 Subject: [PATCH] If the name of an activity is left blank, then give it a generic name matching the name of the module. --- course/mod.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)) { -- 2.39.5