diff --git a/CHANGELOG.md b/CHANGELOG.md index cf9647e..ea91521 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/databaseinventory.xml b/databaseinventory.xml index f67344c..5acdd7c 100644 --- a/databaseinventory.xml +++ b/databaseinventory.xml @@ -26,6 +26,11 @@ ~11.0.0 https://github.com/pluginsGLPI/databaseinventory/releases/download/1.1.0/glpi-databaseinventory-1.1.0.tar.bz2 + + 1.0.5 + ~10.0.0 + https://github.com/pluginsGLPI/databaseinventory/releases/download/1.0.5/glpi-databaseinventory-1.0.5.tar.bz2 + 1.0.4 ~10.0.0 diff --git a/front/computergroup.form.php b/front/computergroup.form.php index 85d6ba6..83e93b4 100644 --- a/front/computergroup.form.php +++ b/front/computergroup.form.php @@ -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'], diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 5525933..267d60d 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -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); @@ -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); @@ -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 { @@ -301,7 +304,7 @@ 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; } @@ -309,7 +312,7 @@ public static function install(Migration $migration) $DB->update( $table, ['search' => $json_search], - ['id' => $id] + ['id' => $id], ); } } diff --git a/setup.php b/setup.php index 88b5d90..f143e66 100644 --- a/setup.php +++ b/setup.php @@ -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');