Skip to content

Commit 12b6d80

Browse files
authored
Fix(Search): Fix undefined array key during database inventory task (#74)
* Fix(Search): Fix undefined array key during database inventory task * fix * remove useless new line * start session before set glpiname
1 parent c52464b commit 12b6d80

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [UNRELEASE]
99

10+
### Fixed
11+
12+
- Fix `Undefined array key "glpiname"` during database inventory task.
13+
1014
## [1.0.3] - 2025-07-10
1115

1216
### Fixed

inc/computergroupdynamic.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ public function isDynamicSearchMatchComputer(Computer $computer)
178178
'value' => $computer->fields['id'],
179179
];
180180

181+
if (!isset($_SESSION['glpiname'])) {
182+
Session::start();
183+
$_SESSION['glpiname'] = 'databaseinventory_plugin';
184+
}
181185
$search_params = Search::manageParams('Computer', $search);
182186
$data = Search::prepareDatasForSearch('Computer', $search_params);
183187
Search::constructSQL($data);

0 commit comments

Comments
 (0)