Utilize ipl\Web\Url::setFilter() where applicable

This commit is contained in:
Johannes Meyer 2023-09-01 14:01:52 +02:00
parent bf9270a76f
commit 4a7dc5af90
2 changed files with 5 additions and 14 deletions

View file

@ -15,7 +15,6 @@ use ipl\Html\HtmlDocument;
use ipl\Html\HtmlString;
use ipl\Orm\ResultSet;
use ipl\Stdlib\BaseFilter;
use ipl\Web\Filter\QueryString;
use ipl\Web\Widget\Link;
/**
@ -68,11 +67,10 @@ class IcingadbGraphs extends BaseHtmlElement
}
$hostUrl = Links::host($hostObj);
$baseFilter = $this->getBaseFilter();
if ($this->hasBaseFilter()) {
$hostUrlParams = $hostUrl->getParams()->toArray(false);
$hostUrl->setQueryString(QueryString::render($this->getBaseFilter()))
->addParams($hostUrlParams);
if ($baseFilter !== null) {
$hostUrl->setFilter($baseFilter);
}
$hostLink = new Link(
@ -85,10 +83,8 @@ class IcingadbGraphs extends BaseHtmlElement
if ($graph->getObjectType() === 'service') {
$serviceUrl = Links::service($object, $hostObj);
if ($this->hasBaseFilter()) {
$serviceUrlParams = $serviceUrl->getParams()->toArray(false);
$serviceUrl->setQueryString(QueryString::render($this->getBaseFilter()))
->addParams($serviceUrlParams);
if ($baseFilter !== null) {
$serviceUrl->setFilter($baseFilter);
}
$serviceLink = new Link(

View file

@ -845,11 +845,6 @@ parameters:
count: 1
path: library/Graphite/Web/Widget/IcingadbGraphs.php
-
message: "#^Parameter \\#1 \\$rule of static method ipl\\\\Web\\\\Filter\\\\QueryString\\:\\:render\\(\\) expects ipl\\\\Stdlib\\\\Filter\\\\Rule, ipl\\\\Stdlib\\\\Filter\\\\Rule\\|null given\\.$#"
count: 2
path: library/Graphite/Web/Widget/IcingadbGraphs.php
-
message: "#^Property Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\IcingadbGraphs\\:\\:\\$defaultAttributes type has no value type specified in iterable type array\\.$#"
count: 1