summaryrefslogtreecommitdiff
path: root/app/Module.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-03-02 22:48:01 +0000
committerGreg Roach <fisharebest@gmail.com>2015-03-02 22:48:01 +0000
commit6bf445790678085ab714acbcb98d992aac06852b (patch)
treee5fbd93b788f412488af10d78b7f5714d08bf598 /app/Module.php
parentf3cdd91fbd8853369cd95f9c12f619f1ad76048c (diff)
downloadwebtrees-6bf445790678085ab714acbcb98d992aac06852b.tar.gz
webtrees-6bf445790678085ab714acbcb98d992aac06852b.tar.bz2
webtrees-6bf445790678085ab714acbcb98d992aac06852b.zip
Fix #455
Diffstat (limited to 'app/Module.php')
-rw-r--r--app/Module.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Module.php b/app/Module.php
index 99b12e8da5..4ef2f4b180 100644
--- a/app/Module.php
+++ b/app/Module.php
@@ -192,7 +192,9 @@ abstract class Module {
foreach ($module_names as $module_name) {
try {
$module = include WT_ROOT . WT_MODULES_DIR . $module_name . '/module.php';
- $modules[$module->getName()] = $module;
+ if ($module instanceof Module) {
+ $modules[$module->getName()] = $module;
+ }
} catch (\ErrorException $ex) {
// Module has been deleted or is broken? Disable it.
Log::addConfigurationLog("Module {$module_name} is missing or broken - disabling it");
@@ -369,15 +371,16 @@ abstract class Module {
foreach (glob(WT_ROOT . WT_MODULES_DIR . '*/module.php') as $file) {
try {
$module = include $file;
- $modules[$module->getName()] = $module;
- Database::prepare("INSERT IGNORE INTO `##module` (module_name, status, menu_order, sidebar_order, tab_order) VALUES (?, ?, ?, ?, ?)")
- ->execute(array(
+ if ($module instanceof Module) {
+ $modules[$module->getName()] = $module;
+ Database::prepare("INSERT IGNORE INTO `##module` (module_name, status, menu_order, sidebar_order, tab_order) VALUES (?, ?, ?, ?, ?)")->execute(array(
$module->getName(),
$default_status,
$module instanceof ModuleMenuInterface ? $module->defaultMenuOrder() : null,
$module instanceof ModuleSidebarInterface ? $module->defaultSidebarOrder() : null,
- $module instanceof ModuleTabInterface ? $module->defaultTabOrder() : null
+ $module instanceof ModuleTabInterface ? $module->defaultTabOrder() : null,
));
+ }
// Set the default privcy for this module. Note that this also sets it for the
// default family tree, with a gedcom_id of -1
if ($module instanceof ModuleMenuInterface) {