PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
30 Apr 2026

Pull Request resolves # .

  • 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

com_content HTML services still use deprecated methods: Factory::getUser() and Factory::getDatabase(). This PR update code to remove the usages of these deprecated methods:

  • Get database from container and inject it to the class
  • For Factory::getUser(), replace it by Factory::getApplication()->getIdentity()
  • For Factory::getUser($userId), replace it by using user factory service to create user.

There should be same changes applied for other components.

Testing Instructions

  • Use Joomla 6.2
  • Apply patch

Test 1

Access to frontend of your site, login using your admin account. Access to an article details page and make sure edit icon is still being displayed OK (no error)

Test 2

  • Setup a multilingual website. Create at least two articles, each article for one language. And setup association between these two articles
  • Access to articles management screen, look at Association column and make sure it is still being displayed properly.
association

Actual result BEFORE applying this Pull Request

Works but use deprecated methods

Expected result AFTER applying this Pull Request

Works without using deprecated methods.

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 joomdonation joomdonation - open - 30 Apr 2026
avatar joomdonation joomdonation - change - 30 Apr 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Apr 2026
Category Administration com_content
avatar joomdonation joomdonation - change - 30 Apr 2026
Labels Added: PR-6.2-dev
avatar laoneo
laoneo - comment - 30 Apr 2026

As this is done in com_content it is possible that extensions are using this class. This will throw an exception then as no database is available. In the upgrade document should be documented that that a database and user factory needs to be injected to stay on the safe side.

avatar brianteeman
brianteeman - comment - 30 Apr 2026

@laoneo doesnt that make it a dangerous breaking change for a minor release?

avatar joomdonation
joomdonation - comment - 30 Apr 2026

I would say these kind of classes are not designed for direct instance class. The right usages would be boot the component and then use HTMLHelper to call these methods. For example HTMLHelper::_('contentadministrator.association', $item->id)

If we still worry about this, then Yes, we can only do these kind of changes in next major release.

avatar laoneo
laoneo - comment - 30 Apr 2026

Changes in components don't fall under our BC promise, so it can go into minor. I personally would do it in major, but this is up to the RM and not me to decide.

avatar joomdonation
joomdonation - comment - 30 Apr 2026

Or stabilizing the code like I did in com_fields https://github.com/joomla/joomla-cms/blob/6.2-dev/administrator/components/com_fields/src/Model/FieldModel.php#L351-L358

Yes. I updated code to use services from container if not injected. Thanks

Add a Comment

Login with GitHub to post a comment