Skip to content

Commit a0ba9b7

Browse files
authored
Fix(Task): prevent undefined index when computer not already linkedo agent (#81)
* Fix(Task): prevent undefined index when computer not already linked to agent * adapt changelog
1 parent 7175b0f commit a0ba9b7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
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 "id"` when computer not already linkedo agent
13+
1014
## [1.0.4] - 2025-09-04
1115

1216
### Fixed

inc/task.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static function handleInventoryTask(array $params)
138138
$database_param_found = [];
139139

140140
// only Computer type
141-
if (get_class($computer) == Computer::getType()) {
141+
if (get_class($computer) == Computer::getType() && !$computer->isNewItem()) {
142142
$database_param_table = PluginDatabaseinventoryDatabaseParam::getTable() ;
143143
$database_param_computergroup_table = PluginDatabaseinventoryDatabaseParam_ComputerGroup::getTable();
144144
$computer_group_static_table = PluginDatabaseinventoryComputerGroupStatic::getTable();

0 commit comments

Comments
 (0)