Create some frontend links in the administrator, for example in an HtmlView::display and visit the view
$link = \Joomla\CMS\Router\Route::link('site', 'index.php', absolute: true);
echo "$link<br>";
\Joomla\CMS\Uri\Uri::reset();
//correct cached
$link = \Joomla\CMS\Router\Route::link('site', 'index.php', absolute: true);
echo "$link<br>";
//administrator
$link = \Joomla\CMS\Router\Route::link('site', 'index.php?b', absolute: true);
echo "$link<br>";
https://example.com/
https://example.com/
https://example.com/?b=
https://example.com/
https://example.com/
https://example.com//administrator/?b=
The second link is returned from cache.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-03-30 06:31:25 |
Closed_By | ⇒ | brbrbr |
Issue confirmed. After
Uri::reset()
, all subsequent calls toRoute::link('site', ...)
incorrectly include/administrator/
in the path. Only the first call returns the correct site URL. Likely caused byUri::getInstance()
rebuilding from the admin context.