From aa77f9ce67de9f1c8d42c8760935a7f8108d7311 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Thu, 25 Jun 2026 10:19:15 +0200 Subject: [PATCH 1/2] `SearchControls`: Add `createSearchEditor()` implementation `callHandleRequest()` returning false prevents the ipl-web trait from calling `handleRequest` for both the created `SearchBar` and `SearchEditor`. `createSearchBar()` already calls it explicitly, the same must be done in `createSearchEditor()`, to create a functional `SearchEditor`. --- library/Icingadb/Common/SearchControls.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/library/Icingadb/Common/SearchControls.php b/library/Icingadb/Common/SearchControls.php index aeecfd587..202dd44b4 100644 --- a/library/Icingadb/Common/SearchControls.php +++ b/library/Icingadb/Common/SearchControls.php @@ -9,6 +9,7 @@ use ipl\Html\Html; use ipl\Orm\Query; use ipl\Web\Control\SearchBar; +use ipl\Web\Control\SearchEditor; use ipl\Web\Url; use ipl\Web\Widget\ContinueWith; @@ -16,6 +17,7 @@ trait SearchControls { use \ipl\Web\Compat\SearchControls { \ipl\Web\Compat\SearchControls::createSearchBar as private webCreateSearchBar; + \ipl\Web\Compat\SearchControls::createSearchEditor as private webCreateSearchEditor; } /** @@ -51,6 +53,20 @@ private function callHandleRequest() return false; } + /** + * Necessary because {@see self::callHandleRequest()} prevents the {@see webCreateSearchEditor()} from calling + * $editor->handleRequest() + * + * @inheritdoc + */ + public function createSearchEditor(Query $query, ...$params): SearchEditor + { + $editor = $this->webCreateSearchEditor($query, ...$params); + $editor->handleRequest($this->getServerRequest()); + + return $editor; + } + /** * Create and return a ContinueWith * From 60d157860274e0b10417ac3cfb34b07609004474 Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Thu, 25 Jun 2026 10:19:36 +0200 Subject: [PATCH 2/2] `SearchControls`: Drop compatibility fix for ipl-web < 0.7.0 17e84986 moved the call of `$searchBar->handleRequest()` and the subsequent call of `assemble()` after an if satement, which served the purpose of adding a missing `.search-controls` wrapper for ipl-web < 0.7.0. Since `SearchBar::assemble` is responsible for adding this wrapper, it was added twice causing a visual bug. --- library/Icingadb/Common/SearchControls.php | 6 --- public/css/common.less | 46 ---------------------- 2 files changed, 52 deletions(-) diff --git a/library/Icingadb/Common/SearchControls.php b/library/Icingadb/Common/SearchControls.php index 202dd44b4..698bbeae8 100644 --- a/library/Icingadb/Common/SearchControls.php +++ b/library/Icingadb/Common/SearchControls.php @@ -6,7 +6,6 @@ namespace Icinga\Module\Icingadb\Common; use Icinga\Module\Icingadb\Hook\SearchColumnsProviderHook; -use ipl\Html\Html; use ipl\Orm\Query; use ipl\Web\Control\SearchBar; use ipl\Web\Control\SearchEditor; @@ -33,11 +32,6 @@ public function createSearchBar(Query $query, ...$params): SearchBar { $searchBar = $this->webCreateSearchBar($query, ...$params); - if (($wrapper = $searchBar->getWrapper()) && ! $wrapper->getWrapper()) { - // TODO: Remove this once ipl-web v0.7.0 is required - $searchBar->addWrapper(Html::tag('div', ['class' => 'search-controls'])); - } - $model = $query->getModel(); $defaultColumns = $model->getSearchColumns(); $columns = SearchColumnsProviderHook::getCustomVarColumns($model, $defaultColumns); diff --git a/public/css/common.less b/public/css/common.less index 1d223dc5c..6279e2727 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -107,52 +107,6 @@ div.show-more { .notice { display: none; } - - // TODO: Remove once ipl-web v0.7.0 is required - &:not(.default-layout) { - .pagination-control { - float: left; - } - - .sort-control { - display: flex; - justify-content: flex-end; - - :not(.form-element) > label { - margin-right: 0; - } - - .control-button { - margin: 0; - } - } - - > :not(:only-child) { - margin-bottom: 0.5em; - } - - .search-suggestions { - margin-bottom: 2.5em; - } - - .search-controls { - clear: both; - display: flex; - min-width: 100%; - - .search-bar { - flex: 1 1 auto; - - & ~ .control-button:last-child { - margin-right: -.5em; - } - - & ~ .control-button { - margin-left: .5em; - } - } - } - } } .content > h2:first-child,