Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/Filter/FilterUrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/core.
*
* (c) 2012-2025 The MetaModels team.
* (c) 2012-2026 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,7 +16,7 @@
* @author Ingolf Steinhardt <info@e-spin.de>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Andreas Fischer <anfischer@kaffee-partner.de>
* @copyright 2012-2025 The MetaModels team.
* @copyright 2012-2026 The MetaModels team.
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
*/
Expand Down Expand Up @@ -182,13 +182,15 @@ public function addFromCurrentRequest(FilterUrl $filterUrl, array $options = nul
$filterUrl->setPageValue('id', \substr($routeName, 8));
$requestUri = \rawurldecode(\substr($request->getPathInfo(), 1));

if (null === ($route = $request->attributes->get('_route_object'))) {
return;
}
assert($route instanceof Route);
if (null === ($pageModel = $request->attributes->get('pageModel'))) {
if (null === ($route = $request->attributes->get('_route_object'))) {
return;
}
assert($route instanceof Route);

$pageModel = $route->getDefault('pageModel');
assert($pageModel instanceof PageModel);
$pageModel = $route->getDefault('pageModel');
assert($pageModel instanceof PageModel);
}

$length = $pageModel->urlSuffix ? -\strlen($pageModel->urlSuffix) : null;
$start = ($pageModel->urlPrefix ? \strlen($pageModel->urlPrefix . '/') : 0)
Expand Down
Loading