From 436a1001b32e639c3d1dd4aed084ca70530c30fc Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 24 May 2018 10:56:01 +0200 Subject: [PATCH 1/2] fix : avoid Notice: Undefined property: stdClass::$MAIN_FEATURES_LEVEL on upgrade.php page where global is not yet defined --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3602ae427bd..66722d51732 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -577,7 +577,7 @@ class Translate //$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label'); } - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); + if (property_exists($conf->global, 'MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); return $newstr; } From ac0570f6b2ec59f420284b93804e965e73f52a3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 May 2018 11:07:11 +0200 Subject: [PATCH 2/2] Update translate.class.php --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 66722d51732..bdcae2e33ea 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -577,7 +577,7 @@ class Translate //$newstr=$this->getLabelFromKey($db,$reg[1],'c_ordersource','code','label'); } - if (property_exists($conf->global, 'MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); + if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) dol_syslog(__METHOD__." missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG); return $newstr; }