From d292f65634987135d641fb4da55f3133ef951663 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Thu, 26 Nov 2020 11:08:09 +0100 Subject: [PATCH] Fixed issue #16861: ComfortUpdateChecker can broke with other plugin (#1668) Dev: don't create a constant name without checking Dev: don't use a global constant name Dev: use Yii --- .../ComfortUpdateChecker/ComfortUpdateChecker.php | 11 ++--------- .../ComfortUpdateChecker/helpers/CUCMenuClass.php | 2 ++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/application/core/plugins/ComfortUpdateChecker/ComfortUpdateChecker.php b/application/core/plugins/ComfortUpdateChecker/ComfortUpdateChecker.php index a7a62b51192..97d7820611e 100644 --- a/application/core/plugins/ComfortUpdateChecker/ComfortUpdateChecker.php +++ b/application/core/plugins/ComfortUpdateChecker/ComfortUpdateChecker.php @@ -1,5 +1,4 @@ subscribe('beforeAdminMenuRender'); } @@ -88,7 +81,7 @@ public function beforeAdminMenuRender() $aMenuItems[] = (new \LimeSurvey\Menu\MenuItem($aMenuItemAdminOptions)); - $oNewMenu = new CUCMenuClass($aMenuItemAdminOptions); + $oNewMenu = new \ComfortUpdateChecker\helpers\CUCMenuClass($aMenuItemAdminOptions); //Check if display only for security update is true in plugin settings and display it otherwhise display all if ($this->get('only_security_update', null, null, false) && $update[key($update)]->security_update) { diff --git a/application/core/plugins/ComfortUpdateChecker/helpers/CUCMenuClass.php b/application/core/plugins/ComfortUpdateChecker/helpers/CUCMenuClass.php index 08d072d2add..4fca7518c8f 100644 --- a/application/core/plugins/ComfortUpdateChecker/helpers/CUCMenuClass.php +++ b/application/core/plugins/ComfortUpdateChecker/helpers/CUCMenuClass.php @@ -3,6 +3,8 @@ /** * Extending the basic menu class with an icon in front of the label */ +namespace ComfortUpdateChecker\helpers; + class CUCMenuClass extends \LimeSurvey\Menu\Menu { public function getLabel()