Skip to content

Commit 4931d1f

Browse files
authored
fix(behavior): adjust namespace for GLPI 11 compatibility (#399)
* fix(behavior): adjust namespace for GLPI 11 compatibility * Update CHANGELOG.md
1 parent c9ff004 commit 4931d1f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- Fix compatibility check with Behaviors plugin
13+
814
## [2.10.0] - 2025-10-01
915

1016
### Added

inc/config.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function showForm($ID, $options = [])
8484
$this->check($ID, READ);
8585

8686
if (Plugin::isPluginActive('behaviors')) {
87-
$behaviorlink = $CFG_GLPI["root_doc"] . "/front/config.form.php?forcetab=PluginBehaviorsConfig%241";
87+
$behaviorlink = $CFG_GLPI["root_doc"] . "/front/config.form.php?forcetab=GlpiPlugin\Behaviors\Config%241";
8888
}
8989

9090
TemplateRenderer::getInstance()->display(

inc/ticket.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,8 @@ public static function assignUserGroup(Ticket $ticket)
537537
}
538538

539539
//check plugin behaviors (for avoid conflict)
540-
if (Plugin::isPluginActive('behaviors')) {
541-
// @phpstan-ignore-next-line
542-
$behavior_config = PluginBehaviorsConfig::getInstance();
540+
if (Plugin::isPluginActive('behaviors') && class_exists('GlpiPlugin\Behaviors\Config')) {
541+
$behavior_config = GlpiPlugin\Behaviors\Config::getInstance();
543542
if ($behavior_config->getField('use_assign_user_group') != 0) {
544543
return false;
545544
}

0 commit comments

Comments
 (0)