From f75e378ec3634a3ec88e1afe7c12171125f86563 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 6 Aug 2019 11:38:24 -0700 Subject: [PATCH] Fixes #3741 - Issue with plugins, menus disappearing or displaying as being uninstalled. --- e107_handlers/plugin_class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index bfc290b69..f399d3d12 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -526,7 +526,7 @@ class e_plugin $path = $row['plugin_path']; - if(!in_array($path,$detected)) + if(!empty($detected) && !in_array($path,$detected)) { $toRemove[] = (int) $row['plugin_id']; continue; @@ -542,6 +542,7 @@ class e_plugin if(!isset($pref[$path])) { $cfg->setPref('plug_installed/'.$path, $row['plugin_version']); + e107::getAdminLog()->addDebug($path)->save("plug_installed pref updated"); $save = true; } } @@ -565,7 +566,8 @@ class e_plugin if($sql->delete('plugin', "plugin_id IN (".$delList.")")) { - e107::getDebug()->log("Deleted missing plugins with id(s): ".$delList); + e107::getAdminLog()->addDebug("Deleted missing plugins with id(s): ".$delList)->save("Plugin Table Updated"); + // e107::getDebug()->log("Deleted missing plugins with id(s): ".$delList); } } @@ -585,6 +587,7 @@ class e_plugin if(!$id = $sql->insert('plugin',$row)) { e107::getDebug()->log("Unable to insert plugin data into table".print_a($row,true)); + e107::getAdminLog()->addDebug("Unable to insert plugin data into table".print_a($row,true))->save("plug_installed pref updated"); } else { @@ -593,6 +596,7 @@ class e_plugin $runUpdate = true; e107::getDebug()->log("Inserting plugin data into table".print_a($row,true)); + e107::getAdminLog()->addArray($row)->save("Plugin Table Entry Added"); if($row['plugin_installflag'] == 1) {