Move problem toggle above shifting params

If the problem toggle is created after the params are shifted, it
redirects to the page without them. To solve this I simply moved
the problem toggle before shifting the params.
This commit is contained in:
Johannes Rauh 2025-08-07 09:35:51 +02:00 committed by Johannes Meyer
parent b5eed40255
commit def4dce4e3

View file

@ -242,11 +242,14 @@ class ServicesController extends Controller
$this->handleSearchRequest($query);
// Create problem toggle before shifting params. Otherwise, the toggle
// will redirect to the grid without the shifted params.
$problemToggle = $this->createProblemToggle();
$this->params->shift('page'); // Handled by PivotTable internally
$this->params->shift('limit'); // Handled by PivotTable internally
$flipped = $this->params->shift('flipped', false);
$problemToggle = $this->createProblemToggle();
$sortControl = $this->createSortControl($query, [
'service.display_name' => t('Service Name'),
'host.display_name' => t('Host Name'),