bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar krishnagandhicode
krishnagandhicode
27 Feb 2026

Pull Request resolves #46610

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Added a <base> tag to the Cassiopeia error.php template header. This ensures that relative assets (like images in custom modules) load correctly when a 404 error occurs on a nested URL.

Testing Instructions

Ensure URL Rewriting is enabled in Global Configuration and the .htaccess file is active.

Go to Administrator > Content > Site Modules
Create a "Custom" module
Set the position to error-404 and assign it to "All Pages"
In the content editor, switch to code view and add an image with a relative path:
for eg: <img src="images/powered_by.png" alt="Test Logo">
Visit http://yourdomain.com/thispagedoesnotexist -> the custom page appears correctly and the image is also visible.
Visit http://yourdomain.com/category/thispagedoesnotexist -> the custom error page does not load the image.

Actual result BEFORE applying this Pull Request

The image fails to load , and the "Home pagee" button links to a non-existent path.

Expected result AFTER applying this Pull Request

The image loads correctly, and the Home button correctly links to the site root.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar krishnagandhicode krishnagandhicode - open - 27 Feb 2026
avatar krishnagandhicode krishnagandhicode - change - 27 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2026
Category Front End Templates (site)
avatar krishnagandhicode krishnagandhicode - change - 27 Feb 2026
The description was changed
avatar krishnagandhicode krishnagandhicode - edited - 27 Feb 2026
avatar krishnagandhicode krishnagandhicode - change - 27 Feb 2026
The description was changed
avatar krishnagandhicode krishnagandhicode - edited - 27 Feb 2026
avatar krishnagandhicode krishnagandhicode - change - 27 Feb 2026
The description was changed
avatar krishnagandhicode krishnagandhicode - edited - 27 Feb 2026
avatar Bodge-IT
Bodge-IT - comment - 27 Feb 2026

< base > seems entirely wrong here to me. The error template should explicitly use absolute paths for its own assets (it mostly already does via jdoc:include), and if users put relative paths in custom modules, that's a documentation/editor issue — not something to fix by globally rebasing all URLs on the error page.

avatar brianteeman
brianteeman - comment - 27 Feb 2026

@Bodge-IT sorry massively disagree with you on that based on real world experience

avatar brianteeman
brianteeman - comment - 27 Feb 2026

@Bodge-IT try using the custom-404 module position and you will see why not having a base is an issue. (Not commenting if this is the correct fix)

avatar Bodge-IT
Bodge-IT - comment - 27 Feb 2026

@Bodge-IT try using the custom-404 module position and you will see why not having a base is an issue. (Not commenting if this is the correct fix)

Yep. just been digging into the issue further and concluded my earlier comment was wrong for the error page.

avatar Bodge-IT Bodge-IT - test_item - 27 Feb 2026 - Tested successfully
avatar Bodge-IT
Bodge-IT - comment - 27 Feb 2026

I have tested this item ✅ successfully on 652f4f8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47251.

avatar exlemor
exlemor - comment - 3 Mar 2026

Hi @krishnagandhicode, did you check multi-lingual sites? and multi-lingual sites that are running from a sub-domain?

I ask because while I do confirm the BEFORE and AFTER condition for:
The image fails to load and then The image loads correctly,

for the Home button, I can't seem to see any difference... (it could be simply that the Joomla router is handling things correctly...

Before I pass or fail this, I wanted to check with you.

avatar krishnagandhicode
krishnagandhicode - comment - 3 Mar 2026

Hi @krishnagandhicode, did you check multi-lingual sites? and multi-lingual sites that are running from a sub-domain?

I ask because while I do confirm the BEFORE and AFTER condition for: The image fails to load and then The image loads correctly,

for the Home button, I can't seem to see any difference... (it could be simply that the Joomla router is handling things correctly...

Before I pass or fail this, I wanted to check with you.

Yes Uri::base() automatically grabs the right physical root URL, also for sub-domains as well.
router handles multilingual sites as well.

You are right about the home button, The original issue (# 46610) mentioned about this ("Back to home page") and I also tested using laragon with joomla in a subfolder so the button actually did break for me, I believe you tested using a hosted site - so it works fine for you.

if the main issue - relative image path is fixed with the patch - then the fix works :)

avatar exlemor exlemor - test_item - 3 Mar 2026 - Tested successfully
avatar exlemor
exlemor - comment - 3 Mar 2026

I have tested this item ✅ successfully on 652f4f8

I have tested this successfully. I was indeed using a hosted site. Thanks @krishnagandhicode!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47251.

avatar richard67 richard67 - change - 3 Mar 2026
Status Pending Ready to Commit
Labels Added: bug PR-5.4-dev
avatar richard67
richard67 - comment - 3 Mar 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47251.

Add a Comment

Login with GitHub to post a comment