Pending

User tests: Successful: Unsuccessful:

avatar shamsbd71
shamsbd71
1 Nov 2026

Pull Request resolves #48713 .

  • 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

When the component router cannot be created (for example a backend-only component that registers a RouterFactory but has no site router class), Route::_() catches the RuntimeException and returns null. The System - SEF plugin did not check for this and called $app->redirect(null, 301), which redirects to the site root and raises Warning: Uninitialized string offset 0 in AbstractWebApplication::redirect().

This PR skips the redirect when Route::_() returns null, both in enforceSEF() (strict routing) and in the tainted URL branch of onAfterRoute(). The request is then handled as it would be with strict routing disabled.

Testing Instructions

  1. Make sure System - SEF is enabled with "Strict Routing" = Yes (default) and Search Engine Friendly URLs is on in Global Configuration. Set Error Reporting to Maximum.
  2. Install a backend-only component that registers a RouterFactory without a site router, e.g. Akeeba Backup or Regular Labs ReReplacer, or the minimal test component attached here (com_routertest.zip).
  3. Open in the frontend: index.php?option=com_routertest&view=json&json=x (or option=com_akeebabackup / option=com_rereplacer).
  4. Open a core non-SEF URL as a control, e.g. index.php?option=com_users&view=login.
  5. Apply the PR and repeat steps 3 and 4.

Actual result BEFORE applying this Pull Request

Step 3: 301 redirect to the homepage, and Warning: Uninitialized string offset 0 in .../AbstractWebApplication.php is raised.
Step 4: 301 redirect to the SEF URL index.php/component/users/login.

48713-before

Expected result AFTER applying this Pull Request

Step 3: no redirect and no warning; the request is handled by the component (the attached test component has no site part, so Joomla shows a 404, same as with Strict Routing = No).
Step 4: unchanged, 301 redirect to the SEF URL.

48713-after

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

com_routertest.zip

avatar shamsbd71 shamsbd71 - open - 1 Nov 2026
avatar shamsbd71 shamsbd71 - change - 1 Nov 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Nov 2026
Category ⇒ Front End Plugins
avatar richard67 richard67 - change - 1 Nov 2026
Title
…
[AI] [6.2] Do not redirect when the SEF route cannot be built
[6.2] [AI] Do not redirect when the SEF route cannot be built
avatar richard67 richard67 - edited - 1 Nov 2026
avatar exlemor
exlemor - comment - 2 Nov 2026

Hello @shamsbd71, I do not see/cannot find an attached com_routertest.zip component, can you please add it to the PR so that I can test it for you? thank you very much.

avatar brianteeman
brianteeman - comment - 2 Nov 2026

@exlemor I tested on both github and issues.joomla.org and in both cases I could download the zip file which I attach here again
com_routertest.zip

avatar exlemor exlemor - test_item - 7 Nov 2026 - Tested successfully
avatar exlemor
exlemor - comment - 7 Nov 2026

I have tested this item ✅ successfully on b421d14

I was able to test your PR fix, thanks @shamsbd71.

Thanks @brianteeman for the .zip file.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48745.
avatar exlemor
exlemor - comment - 7 Nov 2026

I have tested this item ✅ successfully on b421d14

I was able to test your PR fix, thanks @shamsbd71.

Thanks @brianteeman for the .zip file.


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

Add a Comment

Login with GitHub to post a comment