Skip to content

Commit 5c75b8f

Browse files
authored
1.0.5 (#92)
* 1.0.5 * fix CS * fix phstan
1 parent 91762fc commit 5c75b8f

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

CHANGELOG.md

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

88
## [UNRELEASE]
99

10-
### Fixed
10+
## [1.0.5] - 2025-11-25
11+
12+
### Fixed
1113

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

1417
## [1.0.4] - 2025-09-04

databaseinventory.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
<compatibility>~11.0.0</compatibility>
2727
<download_url>https://github.com/pluginsGLPI/databaseinventory/releases/download/1.1.0/glpi-databaseinventory-1.1.0.tar.bz2</download_url>
2828
</version>
29+
<version>
30+
<num>1.0.5</num>
31+
<compatibility>~10.0.0</compatibility>
32+
<download_url>https://github.com/pluginsGLPI/databaseinventory/releases/download/1.0.5/glpi-databaseinventory-1.0.5.tar.bz2</download_url>
33+
</version>
2934
<version>
3035
<num>1.0.4</num>
3136
<compatibility>~10.0.0</compatibility>

front/computergroup.form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
if (isset($_GET['save'])) {
120120
$input = ['plugin_databaseinventory_computergroups_id' => $_GET['plugin_databaseinventory_computergroups_id']];
121121
$search = json_encode([
122-
'is_deleted' => $_GET['is_deleted'] ?? 0,
123122
'is_deleted' => isset($_GET['is_deleted']) ? $_GET['is_deleted'] : 0 ,
124123
'as_map' => isset($_GET['as_map']) ? $_GET['as_map'] : 0,
125124
'criteria' => $_GET['criteria'],

inc/computergroupdynamic.class.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ public static function getSpecificValueToDisplay($field, $values, array $options
9090
$value = ' ';
9191
$out = ' ';
9292
if (strpos($values['id'], Search::NULLVALUE) === false) {
93-
$search_params = Search::manageParams('Computer',
94-
json_decode($values['search'], true, 512, JSON_THROW_ON_ERROR)
93+
$search_params = Search::manageParams(
94+
'Computer',
95+
json_decode($values['search'], true, 512, JSON_THROW_ON_ERROR),
9596
);
9697
$data = Search::prepareDatasForSearch('Computer', $search_params);
9798
Search::constructSQL($data);
@@ -160,8 +161,9 @@ public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $
160161

161162
private function countDynamicItems()
162163
{
163-
$search_params = Search::manageParams('Computer',
164-
json_decode($this->fields['search'], true, 512, JSON_THROW_ON_ERROR)
164+
$search_params = Search::manageParams(
165+
'Computer',
166+
json_decode($this->fields['search'], true, 512, JSON_THROW_ON_ERROR),
165167
);
166168
$data = Search::prepareDatasForSearch('Computer', $search_params);
167169
Search::constructSQL($data);
@@ -212,8 +214,9 @@ private static function showForItem(PluginDatabaseinventoryComputerGroup $comput
212214
'plugin_databaseinventory_computergroups_id' => $ID,
213215
])
214216
) {
215-
$p = Search::manageParams('Computer',
216-
json_decode($computergroup_dynamic->fields['search'], true, 512, JSON_THROW_ON_ERROR)
217+
$p = $search_params = Search::manageParams(
218+
'Computer',
219+
json_decode($computergroup_dynamic->fields['search'], true, 512, JSON_THROW_ON_ERROR),
217220
);
218221
$firsttime = false;
219222
} else {
@@ -301,15 +304,15 @@ public static function install(Migration $migration)
301304
}
302305
} catch (Throwable $e) {
303306
$migration->displayMessage(
304-
"DatabaseInventory - Invalid serialized data for DynamicGroup ID {$id}, data will be reset."
307+
"DatabaseInventory - Invalid serialized data for DynamicGroup ID {$id}, data will be reset.",
305308
);
306309
continue;
307310
}
308311

309312
$DB->update(
310313
$table,
311314
['search' => $json_search],
312-
['id' => $id]
315+
['id' => $id],
313316
);
314317
}
315318
}

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31-
define('PLUGIN_DATABASEINVENTORY_VERSION', '1.0.4');
31+
define('PLUGIN_DATABASEINVENTORY_VERSION', '1.0.5');
3232

3333
// Minimal GLPI version, inclusive
3434
define('PLUGIN_DATABASEINVENTORY_MIN_GLPI', '10.0.0');

0 commit comments

Comments
 (0)