From 6c0506c4cb6561d3b33449e5bc9183b25607317d Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Tue, 18 Nov 2025 11:31:54 +0100 Subject: [PATCH 1/4] Get search on dynamic groups working (temp hack) --- inc/computergroupdynamic.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 11c8577..c4fcbd9 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -228,7 +228,14 @@ private static function showForItem(PluginDatabaseinventoryComputerGroup $comput $p['actionname'] = 'save'; $p['actionvalue'] = _sx('button', 'Save'); $p['showbookmark'] = false; + + + //hack because submit button is not a submit... See https://github.com/glpi-project/glpi/pull/20731 + Safe\ob_start(); Search::showGenericSearch(Computer::getType(), $p); + $generic_search = Safe\ob_get_clean(); + echo Safe\preg_replace('/type="button" name="save"/', 'type="submit" name="save"', $generic_search); + //display result from search if (!$firsttime) { From 95b2e1989ea54a368751745a5a2985568b1d5a4b Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Tue, 18 Nov 2025 11:33:09 +0100 Subject: [PATCH 2/4] adapt changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ccbc40..5e96074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [UNRELEASED] + +## Fixed + +- Fix dynamic group submit bouton + ## [1.1.1] - 2025-11-13 ### Fixed From 550d9284e9b183426130f9e65d1b119316245d89 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Tue, 18 Nov 2025 12:12:20 +0100 Subject: [PATCH 3/4] fix CS --- inc/computergroupdynamic.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index c4fcbd9..07d274b 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -28,6 +28,8 @@ * ------------------------------------------------------------------------- */ +use function Safe\ob_start; +use function Safe\ob_get_clean; use function Safe\preg_match; use function Safe\preg_replace; use function Safe\preg_split; @@ -231,10 +233,10 @@ private static function showForItem(PluginDatabaseinventoryComputerGroup $comput //hack because submit button is not a submit... See https://github.com/glpi-project/glpi/pull/20731 - Safe\ob_start(); + ob_start(); Search::showGenericSearch(Computer::getType(), $p); - $generic_search = Safe\ob_get_clean(); - echo Safe\preg_replace('/type="button" name="save"/', 'type="submit" name="save"', $generic_search); + $generic_search = ob_get_clean(); + echo preg_replace('/type="button" name="save"/', 'type="submit" name="save"', $generic_search); //display result from search From 768345c00566dc1e75b3db5ac913410d59347405 Mon Sep 17 00:00:00 2001 From: Stanislas Kita Date: Tue, 18 Nov 2025 14:05:09 +0100 Subject: [PATCH 4/4] fix --- CHANGELOG.md | 2 +- inc/computergroupdynamic.class.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e96074..4b77386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELEASED] -## Fixed +### Fixed - Fix dynamic group submit bouton diff --git a/inc/computergroupdynamic.class.php b/inc/computergroupdynamic.class.php index 07d274b..a663b26 100644 --- a/inc/computergroupdynamic.class.php +++ b/inc/computergroupdynamic.class.php @@ -231,14 +231,12 @@ private static function showForItem(PluginDatabaseinventoryComputerGroup $comput $p['actionvalue'] = _sx('button', 'Save'); $p['showbookmark'] = false; - //hack because submit button is not a submit... See https://github.com/glpi-project/glpi/pull/20731 ob_start(); Search::showGenericSearch(Computer::getType(), $p); $generic_search = ob_get_clean(); echo preg_replace('/type="button" name="save"/', 'type="submit" name="save"', $generic_search); - //display result from search if (!$firsttime) { $data = Search::prepareDatasForSearch('Computer', $search_params);