Skip to content

Commit

Permalink
Fixed issue #16861: ComfortUpdateChecker can broke with other plugin (#…
Browse files Browse the repository at this point in the history
…1668)

Dev: don't create a constant name without checking
Dev: don't use a global constant name
Dev: use Yii
  • Loading branch information
Shnoulle committed Nov 26, 2020
1 parent 2ded631 commit d292f65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
@@ -1,5 +1,4 @@
<?php

/*
* Update Checker for Comfort Update users
* Copyright (C) LimeSurvey GmbH
Expand All @@ -10,12 +9,6 @@
* other free or open source software licenses.
*/

define('ROOT_FOLDER', __DIR__ . '/');

//loads libraries
require_once(ROOT_FOLDER . 'helpers/CUCMenuClass.php');


class ComfortUpdateChecker extends PluginBase
{

Expand Down Expand Up @@ -44,7 +37,7 @@ class ComfortUpdateChecker extends PluginBase

public function init()
{

Yii::setPathOfAlias(get_class($this), dirname(__FILE__));
$this->subscribe('beforeAdminMenuRender');
}

Expand Down Expand Up @@ -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) {
Expand Down
Expand Up @@ -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()
Expand Down

0 comments on commit d292f65

Please sign in to comment.