Permalink
Browse files

Prevent a wearning message from being displayed around the modules me…

…nu on

a fresh install of Moodle.
  • Loading branch information...
1 parent 4f1b940 commit 19216ba3d8104a53037b7ef35201df06f5d460f7 mchurch committed Sep 19, 2005
Showing with 5 additions and 1 deletion.
  1. +5 −1 admin/configvars.php
View
@@ -237,7 +237,11 @@ function togglemodules(index) {
if (!empty($config->defaultallowedmodules)) {
$allowedmodules = explode(',',$config->defaultallowedmodules);
}
- $mods = get_records("modules");
+
+// On a fresh install of Moodle, this could be empty; prevent a warning on the following loop.
+ if (!$mods = get_records("modules")) {
+ $mods = array();
+ }
$s = "selected=\"selected\"";
$allowstr .= '<option value="0" '.((empty($allowedmodules)) ? $s : '').'>'.get_string('allownone').'</option>'."\n";
foreach ($mods as $mod) {

0 comments on commit 19216ba

Please sign in to comment.