From 1fbb0b4c5fa4beac2eb285f29667484d8f9e34cf Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 16 Mar 2023 14:06:55 +0800 Subject: [PATCH] * fix for upgrade. --- framework/router.class.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index 52d68f48d1..11d4224ba6 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -109,9 +109,15 @@ class router extends baseRouter parent::loadLang($moduleName, $appName); /* Replace main nav lang. */ - if($moduleName == 'common' and $this->dbh and !empty($this->config->db->name) and !defined('IN_UPGRADE')) + if($moduleName == 'common' and $this->dbh and !empty($this->config->db->name)) { - $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `section`='mainNav' AND `lang`='{$this->clientLang}' AND `vision`='{$this->config->vision}'")->fetchAll(); + $customMenus = array(); + try + { + $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `section`='mainNav' AND `lang`='{$this->clientLang}' AND `vision`='{$this->config->vision}'")->fetchAll(); + } + catch(PDOException $exception){} + foreach($customMenus as $menu) { $menuKey = $menu->key; @@ -317,7 +323,12 @@ class router extends baseRouter } /* Replace common lang. */ - $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `lang`='{$this->clientLang}' AND `section`='' AND `vision`='{$config->vision}'")->fetchAll(); + $customMenus = array(); + try + { + $customMenus = $this->dbh->query('SELECT * FROM' . TABLE_LANG . "WHERE `module`='common' AND `lang`='{$this->clientLang}' AND `section`='' AND `vision`='{$config->vision}'")->fetchAll(); + } + catch(PDOException $exception){} foreach($customMenus as $menu) if(isset($lang->{$menu->key})) $lang->{$menu->key} = $menu->value; } }