bug PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
24 Feb 2025

Pull Request for Issue #44990 .

Summary of Changes

This pull request (PR) changes the getInstance method of the Joomla\CMS\Router\Router class to use full qualified class name in case if the deprecated old "JRouter" class aliases are not available (b/c plugin switched off).

The issue has been reported for 5.3.0-beta1, but it exists already in 5.2-dev code, so I've made this PR here for 5.2-dev.

But if maintainers want I can rebase to 5.3-dev.

Testing Instructions

See issue #44990 .

Actual result BEFORE applying this Pull Request

See issue #44990 .

Expected result AFTER applying this Pull Request

No such issue with the router, it uses the right full class names \\Joomla\\CMS\\Router\\AdministratorRouter and \\Joomla\\CMS\\Router\\SiteRouter if the J aliases are not available (b/c plugin switched off).

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar richard67 richard67 - open - 24 Feb 2025
avatar richard67 richard67 - change - 24 Feb 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2025
Category Libraries
avatar richard67 richard67 - change - 24 Feb 2025
The description was changed
avatar richard67 richard67 - edited - 24 Feb 2025
avatar HLeithner
HLeithner - comment - 24 Feb 2025

Technically this is a b/c break, I would check first if the JRouterXXX class exists if not fall back to the namespaced version.

avatar richard67
richard67 - comment - 24 Feb 2025

Technically this is a b/c break, I would check first if the JRouterXXX class exists if not fall back to the namespaced version.

@HLeithner Well, I just see that the complete getInstance method is deprecated anyway and will be removed with 6.0, so maybe leave it as it is and close this PR?

avatar HLeithner
HLeithner - comment - 24 Feb 2025

would mean it's broken until eol of 5.4... Just add your code as fallback into the if statement, that should be ok.

avatar richard67 richard67 - change - 24 Feb 2025
Labels Added: bug PR-5.2-dev
avatar richard67
richard67 - comment - 24 Feb 2025

Done.

avatar richard67 richard67 - change - 24 Feb 2025
The description was changed
avatar richard67 richard67 - edited - 24 Feb 2025
avatar richard67 richard67 - change - 24 Feb 2025
Title
[5.2] Do not use deprecated JRouter alias in core
[5.2] Fall back to full qualified class name if JRouter alias is not available
avatar richard67 richard67 - edited - 24 Feb 2025

Add a Comment

Login with GitHub to post a comment