diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c212ba..2af4cf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASE] +### Fixed + +- Fix `Undefined array key "glpiname"` during database inventory task. + ## [1.0.3] - 2025-07-10 ### Fixed diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 39c7e89..545a6a1 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -178,6 +178,10 @@ public function isDynamicSearchMatchComputer(Computer $computer) 'value' => $computer->fields['id'], ]; + if (!isset($_SESSION['glpiname'])) { + Session::start(); + $_SESSION['glpiname'] = 'databaseinventory_plugin'; + } $search_params = Search::manageParams('Computer', $search); $data = Search::prepareDatasForSearch('Computer', $search_params); Search::constructSQL($data);