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.
This commit is contained in:
Bastian Lederer 2026-04-21 13:21:09 +02:00
parent 07df145091
commit abc8aaf23e
2 changed files with 7 additions and 4 deletions

View file

@ -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();

View file

@ -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();