From caee889b7f97b8316e2d8678379039d388217afe Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 14:21:29 -0700 Subject: [PATCH] Fixes Plugin Database structure update detection. --- e107_admin/update_routines.php | 5 ++++- e107_handlers/admin_ui.php | 2 +- e107_handlers/db_verify_class.php | 11 ++++++++--- e107_handlers/plugin_class.php | 10 +++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 061700fba..2329b9fd4 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -235,12 +235,15 @@ class e107Update { return false; } - + $frm = e107::getForm(); $tp = e107::getParser(); $text = ""; + + uksort($list, "strnatcasecmp"); + foreach($list as $path=>$val) { $name = !empty($val['@attributes']['lan']) ? $tp->toHtml($val['@attributes']['lan'],false,'TITLE') : $val['@attributes']['name']; diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index cc1d97931..5d28eabfc 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1588,7 +1588,7 @@ class e_admin_dispatcher { $icon = e107::getPlugin()->getIcon(e_CURRENT_PLUGIN, 32, ''); } - + return e107::getNav()->admin($icon."".$this->menuTitle."", $selected, $var); } diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 4ce0e217e..e9827981a 100644 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -55,7 +55,6 @@ class db_verify function __construct() { - $sql = e107::getDb(); $sql->gen('SET SQL_QUOTE_SHOW_CREATE = 1'); @@ -74,8 +73,6 @@ class db_verify } - - $this->sqlLanguageTables = $this->getSqlLanguages(); // $this->loadCreateTableData(); @@ -84,6 +81,13 @@ class db_verify } + public function clearCache() + { + + return e107::getCache()->clear(self::cachetag, true); + + } + private function load() { $mes = e107::getMessage(); @@ -232,6 +236,7 @@ class db_verify } } } + } diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 294440746..cac3ae919 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1050,10 +1050,9 @@ class e107plugin { return FALSE; } - - // require_once(e_HANDLER."db_verify_class.php"); - $dbv = e107::getSingleton('db_verify', e_HANDLER."db_verify_class.php"); - + + + $dbv = e107::getObject('db_verify', "{e_HANDLER}db_verify_class.php"); $plg = e107::getPlug(); @@ -1075,6 +1074,7 @@ class e107plugin if($dbv->errors()) { + $mes->addDebug("Plugin Update(s) Required - db structure change [".$path."]"); $needed[$path] = $data; } } @@ -1119,7 +1119,7 @@ class e107plugin { $log->addDebug("Plugin: {$path} requires an update."); } - + return count($needed) ? $needed : FALSE; }