Skip to content

Commit c31096f

Browse files
(Host/Service)groupController: Don't overwrite the (SearchBar/SearchEditor) suggestionUrl
SuggestionUrl now uses the preserveParams as default params require: Icinga/ipl-web#233
1 parent 4806939 commit c31096f

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

application/controllers/HostgroupController.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use ipl\Stdlib\Filter;
1919
use ipl\Web\Control\LimitControl;
2020
use ipl\Web\Control\SortControl;
21-
use ipl\Web\Url;
2221

2322
class HostgroupController extends Controller
2423
{
@@ -84,14 +83,7 @@ public function indexAction(): Generator
8483
$sortControl->getSortParam(),
8584
$viewModeSwitcher->getViewModeParam(),
8685
'name'
87-
])->setSuggestionUrl(Url::fromPath(
88-
'icingadb/hostgroup/complete',
89-
[
90-
'name' => $this->hostgroupName,
91-
'_disableLayout' => true,
92-
'showCompact' => true
93-
]
94-
));
86+
]);
9587

9688
if ($searchBar->hasBeenSent() && ! $searchBar->isValid()) {
9789
if ($searchBar->hasBeenSubmitted()) {
@@ -156,6 +148,10 @@ public function searchEditorAction(): void
156148
'name'
157149
]);
158150

151+
if ($editor->getSuggestionUrl()) {
152+
$editor->getSuggestionUrl()->addParams(['name' => $this->hostgroupName]);
153+
}
154+
159155
$this->getDocument()->add($editor);
160156
$this->setTitle(t('Adjust Filter'));
161157
}

application/controllers/ServicegroupController.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use ipl\Stdlib\Filter;
1919
use ipl\Web\Control\LimitControl;
2020
use ipl\Web\Control\SortControl;
21-
use ipl\Web\Url;
2221

2322
class ServicegroupController extends Controller
2423
{
@@ -92,14 +91,7 @@ public function indexAction(): Generator
9291
$sortControl->getSortParam(),
9392
$viewModeSwitcher->getViewModeParam(),
9493
'name'
95-
])->setSuggestionUrl(Url::fromPath(
96-
'icingadb/servicegroup/complete',
97-
[
98-
'name' => $this->servicegroupName,
99-
'_disableLayout' => true,
100-
'showCompact' => true
101-
]
102-
));
94+
]);
10395

10496
if ($searchBar->hasBeenSent() && ! $searchBar->isValid()) {
10597
if ($searchBar->hasBeenSubmitted()) {

0 commit comments

Comments
 (0)