Prevent use of empty filters in FilterChain::toQueryString()
Due to instantiation of filters using Filter::matchAll() in ObjectList::getFilter(), we get an empty FilterAnd instance when $this->filter is null. This prepends unnecessary separator '&' to the query string during conversion of filter to querystring. This breaks the state badge links for host and service lists.
This commit is contained in:
parent
c5cf7abf0d
commit
199ea6f965
|
@ -171,8 +171,10 @@ abstract class FilterChain extends Filter
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
foreach ($this->filters() as $filter) {
|
foreach ($this->filters() as $filter) {
|
||||||
|
if (! $filter->isEmpty()) {
|
||||||
$parts[] = $filter->toQueryString();
|
$parts[] = $filter->toQueryString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: getLevel??
|
// TODO: getLevel??
|
||||||
if (strpos($this->getId(), '-')) {
|
if (strpos($this->getId(), '-')) {
|
||||||
|
|
Loading…
Reference in New Issue