MDL-52945 modinfo: Avoid uservisible when module already used.
authorRussell Smith <mr-russ@smith2001.net>
Thu, 3 Mar 2016 05:03:19 +0000 (16:03 +1100)
committerRussell Smith <mr-russ@smith2001.net>
Thu, 3 Mar 2016 05:03:19 +0000 (16:03 +1100)
lib/modinfolib.php

index ff0a4f7..23aeb8e 100644 (file)
@@ -250,7 +250,7 @@ class course_modinfo {
         $modnames = get_module_types_names($plural);
         $modnamesused = array();
         foreach ($this->get_cms() as $cmid => $mod) {
-            if (isset($modnames[$mod->modname]) && $mod->uservisible) {
+            if (!isset($modnamesused[$mod->modname]) && isset($modnames[$mod->modname]) && $mod->uservisible) {
                 $modnamesused[$mod->modname] = $modnames[$mod->modname];
             }
         }