No Code Attached Yet
avatar brbrbr
brbrbr
26 Mar 2025

Steps to reproduce the issue

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>";

Expected result

https://example.com/
https://example.com/
https://example.com/?b=

Actual result

https://example.com/
https://example.com/
https://example.com//administrator/?b=

Additional comments

The second link is returned from cache.

avatar brbrbr brbrbr - open - 26 Mar 2025
avatar joomla-cms-bot joomla-cms-bot - change - 26 Mar 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Mar 2025
avatar AdarshSantoria
AdarshSantoria - comment - 28 Mar 2025

Issue confirmed. After Uri::reset(), all subsequent calls to Route::link('site', ...) incorrectly include /administrator/ in the path. Only the first call returns the correct site URL. Likely caused by Uri::getInstance() rebuilding from the admin context.

avatar fgsw
fgsw - comment - 29 Mar 2025

@brbrbr Can you test #45252 and if its successul close the issue?

avatar brbrbr brbrbr - change - 30 Mar 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-03-30 06:31:25
Closed_By brbrbr
avatar brbrbr brbrbr - close - 30 Mar 2025

Add a Comment

Login with GitHub to post a comment