Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [UNRELEASE]

### Fixed
## [1.0.5] - 2025-11-25

### Fixed

- Migrate dynamic group search from serialized to JSON format
- Fix `Undefined array key "id"` when computer not already linkedo agent

## [1.0.4] - 2025-09-04
Expand Down
5 changes: 5 additions & 0 deletions databaseinventory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<compatibility>~11.0.0</compatibility>
<download_url>https://github.com/pluginsGLPI/databaseinventory/releases/download/1.1.0/glpi-databaseinventory-1.1.0.tar.bz2</download_url>
</version>
<version>
<num>1.0.5</num>
<compatibility>~10.0.0</compatibility>
<download_url>https://github.com/pluginsGLPI/databaseinventory/releases/download/1.0.5/glpi-databaseinventory-1.0.5.tar.bz2</download_url>
</version>
<version>
<num>1.0.4</num>
<compatibility>~10.0.0</compatibility>
Expand Down
1 change: 0 additions & 1 deletion front/computergroup.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
if (isset($_GET['save'])) {
$input = ['plugin_databaseinventory_computergroups_id' => $_GET['plugin_databaseinventory_computergroups_id']];
$search = json_encode([
'is_deleted' => $_GET['is_deleted'] ?? 0,
'is_deleted' => isset($_GET['is_deleted']) ? $_GET['is_deleted'] : 0 ,
'as_map' => isset($_GET['as_map']) ? $_GET['as_map'] : 0,
'criteria' => $_GET['criteria'],
Expand Down
19 changes: 11 additions & 8 deletions inc/computergroupdynamic.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ public static function getSpecificValueToDisplay($field, $values, array $options
$value = ' ';
$out = ' ';
if (strpos($values['id'], Search::NULLVALUE) === false) {
$search_params = Search::manageParams('Computer',
json_decode($values['search'], true, 512, JSON_THROW_ON_ERROR)
$search_params = Search::manageParams(
'Computer',
json_decode($values['search'], true, 512, JSON_THROW_ON_ERROR),
);
$data = Search::prepareDatasForSearch('Computer', $search_params);
Search::constructSQL($data);
Expand Down Expand Up @@ -160,8 +161,9 @@ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $

private function countDynamicItems()
{
$search_params = Search::manageParams('Computer',
json_decode($this->fields['search'], true, 512, JSON_THROW_ON_ERROR)
$search_params = Search::manageParams(
'Computer',
json_decode($this->fields['search'], true, 512, JSON_THROW_ON_ERROR),
);
$data = Search::prepareDatasForSearch('Computer', $search_params);
Search::constructSQL($data);
Expand Down Expand Up @@ -212,8 +214,9 @@ private static function showForItem(PluginDatabaseinventoryComputerGroup $comput
'plugin_databaseinventory_computergroups_id' => $ID,
])
) {
$p = Search::manageParams('Computer',
json_decode($computergroup_dynamic->fields['search'], true, 512, JSON_THROW_ON_ERROR)
$p = $search_params = Search::manageParams(
'Computer',
json_decode($computergroup_dynamic->fields['search'], true, 512, JSON_THROW_ON_ERROR),
);
$firsttime = false;
} else {
Expand Down Expand Up @@ -301,15 +304,15 @@ public static function install(Migration $migration)
}
} catch (Throwable $e) {
$migration->displayMessage(
"DatabaseInventory - Invalid serialized data for DynamicGroup ID {$id}, data will be reset."
"DatabaseInventory - Invalid serialized data for DynamicGroup ID {$id}, data will be reset.",
);
continue;
}

$DB->update(
$table,
['search' => $json_search],
['id' => $id]
['id' => $id],
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* -------------------------------------------------------------------------
*/

define('PLUGIN_DATABASEINVENTORY_VERSION', '1.0.4');
define('PLUGIN_DATABASEINVENTORY_VERSION', '1.0.5');

// Minimal GLPI version, inclusive
define('PLUGIN_DATABASEINVENTORY_MIN_GLPI', '10.0.0');
Expand Down