RTC PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
27 Jul 2025

Pull Request for Issue # .

Summary of Changes

This PR replaces the use of the deprecated getUser with getIdentity

Testing Instructions

Create an admin module to display the most popular articles
Test with the author filters
image

Actual result BEFORE and AFTER applying this Pull Request

identical

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 brianteeman brianteeman - open - 27 Jul 2025
avatar brianteeman brianteeman - change - 27 Jul 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jul 2025
Category Modules Administration
avatar brianteeman brianteeman - change - 27 Jul 2025
Labels Added: PR-6.0-dev
09114bb 27 Jul 2025 avatar brianteeman space
avatar exlemor exlemor - test_item - 27 Jul 2025 - Tested successfully
avatar exlemor
exlemor - comment - 27 Jul 2025

I have tested this item ✅ successfully on 09114bb

I have successfully tested this - including changing the author of Articles to compare, delete articles/empty trash etc. Thanks @brianteeman


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

avatar hans2103 hans2103 - test_item - 28 Jul 2025 - Tested successfully
avatar hans2103
hans2103 - comment - 28 Jul 2025

I have tested this item ✅ successfully on 09114bb


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

avatar QuyTon QuyTon - change - 28 Jul 2025
Status Pending Ready to Commit
avatar QuyTon
QuyTon - comment - 28 Jul 2025

RTC


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

avatar softforge softforge - change - 30 Jul 2025
Labels Added: RTC
avatar softforge softforge - close - 30 Jul 2025
avatar softforge softforge - merge - 30 Jul 2025
avatar softforge softforge - change - 30 Jul 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-07-30 09:01:01
Closed_By softforge
avatar softforge
softforge - comment - 30 Jul 2025

Thanks for another user centered fix

avatar rdeutz
rdeutz - comment - 31 Jul 2025

Just to be clear right from the start, there is nothing wrong with this PR. It was done in the way we documented, it should be done.

That's said, there are better ways. What we want is to reduce the use of static code and super globals, replacing Factory::getUser() with Factory::getApplication->getIdentity() brings us not so much nearer to the goal. The current mod_popular is done in an old way not using a dispatcher and having a static helper class to get the information.

Our dispatcher class has the application object automatically injected and so we don't need the Factory::getApplication part. Instead we can use $this->getApplication()->getIdentity(). This is much better, also more complicated but better in the long run.

#45808 is an example how to do it.

Why I am saying all of this. We discussed the change in the maintainers meeting and decided to merge the currently open replacement getUser PRs but we also want to show how to do better. A module build with a dispachter has the application object injected, so the way is to convert the module code to use a dispacher. Same for plugins, events and views, these classes have also the application injected.

avatar brianteeman
brianteeman - comment - 31 Jul 2025

Just to be clear right from the start, there is nothing wrong with this PR. It was done in the way we documented, it should be done.

will you be updating the documentation?

avatar rdeutz
rdeutz - comment - 31 Jul 2025

will you be updating the documentation?

I really would like to do it, but we trigger the message in the getUser function and how to replace is different from where you call it.

We have a bit of documentation here: https://manual.joomla.org/migrations/44-50/#replacement-of-factorygetuser pointing in the right direction but we can be better.

avatar brianteeman
brianteeman - comment - 31 Jul 2025

it is hard for people to help when the documentation is not clear

avatar Hackwar
Hackwar - comment - 31 Jul 2025

@brianteeman fully agree. We are working on this. Unfortunately, the problems aren't easy to solve and the internal discussions about this are ongoing.

avatar brianteeman
brianteeman - comment - 31 Jul 2025

These conversations should have taken place when the code was deprecated and not years later.

avatar Hackwar
Hackwar - comment - 31 Jul 2025

All people involved fully agree with you here. Unfortunately the people who did this have long left the project. We are currently doing their cleanup work.

Add a Comment

Login with GitHub to post a comment