Permalink
Browse files

MDL-28723 Make sure that the arrays used by print_plugin_tables() are…

… correctly initialized

This covers a very rare and unexpected case when no mods or no blocks
are installed. Credit goes to Aparup Banerjee for spotting this.
1 parent 1287d5e commit 1824a69d7af76fc014e3352744d94a81c12c1593 @mudrd8mz mudrd8mz committed Aug 16, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/adminlib.php
View
4 lib/adminlib.php
@@ -4942,14 +4942,18 @@ function print_plugin_tables() {
$installed_mods = get_records_list('modules', '', '', '', 'name');
$installed_blocks = get_records_list('block', '', '', '', 'name');
+ $plugins_installed['mod'] = array();
foreach($installed_mods as $mod) {
$plugins_installed['mod'][] = $mod->name;
}
+ $plugins_installed['blocks'] = array();
foreach($installed_blocks as $block) {
$plugins_installed['blocks'][] = $block->name;
}
+ $plugins_installed['filter'] = array();
+
$plugins_ondisk = array();
$plugins_ondisk['mod'] = get_list_of_plugins('mod', 'db');
$plugins_ondisk['blocks'] = get_list_of_plugins('blocks', 'db');

0 comments on commit 1824a69

Please sign in to comment.