From abc8aaf23ea42596e8eaaa8658041da241fe8e1c Mon Sep 17 00:00:00 2001 From: Bastian Lederer Date: Tue, 21 Apr 2026 13:21:09 +0200 Subject: [PATCH] Use `UrlParams::addValues` instead `Url::setParams` Previously `Url::setParams()` was used by `ServiceController::historyAction` to set `name` and `host.name`, since the function overwrites all parameters the sort parameter was not included in the loadMoreUrl. `UrlParams::addValues` fixes this problem sicne is keeps the existing parameters. For consistency `HostController::historyAction` is also adjusted to match this implementation. --- application/controllers/HostController.php | 5 +++-- application/controllers/ServiceController.php | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index be1268e2..5e00e949 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -141,8 +141,9 @@ class HostController extends Controller $before = $this->params->shift('before', time()); $previousTimestamp = $this->params->shift('last-entry'); - $url = Url::fromRequest()->setParams(clone $this->params); - $url->setParam('name', $this->host->name); + $url = Url::fromRequest()->setParams( + (clone $this->params)->add('name', $this->host->name) + ); $timestampControl = $this->createTimestampControl(); $limitControl = $this->createLimitControl(); diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index ddfec2ce..775268aa 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -291,8 +291,10 @@ class ServiceController extends Controller $before = $this->params->shift('before', time()); $previousTimestamp = $this->params->shift('last-entry'); - $url = Url::fromRequest()->setParams(clone $this->params); - $url->setParams(['name' => $this->service->name, 'host.name' => $this->service->host->name]); + $url = Url::fromRequest()->setParams( + (clone $this->params) + ->addValues(['name' => $this->service->name, 'host.name' => $this->service->host->name]) + ); $timestampControl = $this->createTimestampControl(); $limitControl = $this->createLimitControl();