Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Fall back to full qualified class name if JRouter alias is not available #44994

Open
wants to merge 2 commits into
base: 5.2-dev
Choose a base branch
from

Conversation

richard67
Copy link
Member

@richard67 richard67 commented Feb 24, 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

@HLeithner
Copy link
Member

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

@richard67
Copy link
Member Author

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?

@HLeithner
Copy link
Member

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

@richard67
Copy link
Member Author

Done.

@richard67 richard67 changed the 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 Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants