monitoring: Clone the filter for the grid links

Before, it was impossible to change an existing filter via the filter
editor in the host and service group views because of an exception about
wrong IDs.
The filter editor sets the IDs correctly. But since we're adding the
filter again to another URL, FilterChain::addFilter() overrides the IDs
because it is not working with a clone.
This commit is contained in:
Eric Lippmann 2019-07-29 13:17:22 +02:00
parent d2a2eae600
commit a94e8fb211
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ if (! $this->compact): ?>
<div class="sort-controls-container">
<?= $this->limiter ?>
<?= $this->sortBox ?>
<a href="<?= $this->href('monitoring/list/hostgroup-grid')->addFilter($this->filterEditor->getFilter()) ?>" class="grid-toggle-link"
<a href="<?= $this->href('monitoring/list/hostgroup-grid')->addFilter(clone $this->filterEditor->getFilter()) ?>" class="grid-toggle-link"
title="<?= $this->translate('Toogle grid view mode') ?>">
<?= $this->icon('th-list', null, ['class' => '-active']) ?>
<?= $this->icon('th-thumb-empty', null, ['class' => '-inactive']) ?>

View File

@ -7,7 +7,7 @@ if (! $this->compact): ?>
<div class="sort-controls-container">
<?= $this->limiter ?>
<?= $this->sortBox ?>
<a href="<?= $this->href('monitoring/list/servicegroup-grid')->addFilter($this->filterEditor->getFilter()) ?>" class="grid-toggle-link"
<a href="<?= $this->href('monitoring/list/servicegroup-grid')->addFilter(clone $this->filterEditor->getFilter()) ?>" class="grid-toggle-link"
title="<?= $this->translate('Toogle grid view mode') ?>">
<?= $this->icon('th-list', null, ['class' => '-active']) ?>
<?= $this->icon('th-thumb-empty', null, ['class' => '-inactive']) ?>