Conflicting Files ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
27 Dec 2021

Removes all calls to the deprecated Factory::getUser() method with the Factory::getApplication()->getIdentity() chained method.

Factory::getUser() is slated for removal in Joomla 5

Manually reviewed each of the changes...

ONLY changed where original was a full call to Factory::getUser() and replaced like for like.

Code review.

avatar PhilETaylor PhilETaylor - open - 27 Dec 2021
avatar PhilETaylor PhilETaylor - change - 27 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Dec 2021
Category Administration com_associations com_banners com_categories com_config com_contact com_content
avatar PhilETaylor PhilETaylor - change - 27 Dec 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 27 Dec 2021
avatar PhilETaylor PhilETaylor - change - 27 Dec 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 27 Dec 2021
Category Administration com_associations com_banners com_categories com_config com_contact com_content Administration com_admin com_associations com_banners com_cache com_categories com_config com_contact
avatar PhilETaylor PhilETaylor - change - 27 Dec 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 27 Dec 2021
avatar PhilETaylor
PhilETaylor - comment - 27 Dec 2021

Converting back to draft because... when a user is not logged in

Factory::getApplication()->getIdentity() = null

whereas

Factory::getUser() = an empty Joomla\CMS\User\User object

!!!

avatar PhilETaylor PhilETaylor - change - 27 Dec 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-12-27 22:15:25
Closed_By PhilETaylor
avatar PhilETaylor
PhilETaylor - comment - 27 Dec 2021

Ok @wilsonge you up for this challenge?

The back end is fine - its only the frontend having issues, PluginHelper and SiteApplication seem to be the two files that need touching but I cannot seem to find the "right way" to do this.

It seems that Joomla is highly dependant on getUser returning a empty User class when not logged in... so that ->getAuthorisedLevels() and other methods can be run on a guest user.

The deprecation message therefore is wrong as the two methods are not the same. getUser loads from self::getApplication()->getSession()->get('user') and getIdentify just loads from the class property - and is null if the user is logged out.

Or is the correct "fix" to refactor most of the frontend, and all the 3PD extensions so that they check getIdentity and see if its null or not before using it? ... but then you could have ACL on your logged out users - but as your logged out user is NULL and not a blank user object that levels can be checked on... you are screwed... haha.

Until this is resolved, the use of Factory::getApplication()->getIdentity() on the frontend, where users could be logged out, should be minimised...

Installation is also broken (unit tests show that)

avatar PhilETaylor PhilETaylor - close - 27 Dec 2021
avatar PhilETaylor
PhilETaylor - comment - 27 Dec 2021

leaving here - you can checkout this PR to see the problem that needs fixing... once we have a solution we can test and merge this one.

avatar PhilETaylor PhilETaylor - change - 1 Jan 2022
Status Closed New
Closed_Date 2021-12-27 22:15:25
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - change - 1 Jan 2022
Status New Pending
avatar PhilETaylor PhilETaylor - reopen - 1 Jan 2022
avatar PhilETaylor
PhilETaylor - comment - 1 Jan 2022

Conflicts resolved.

avatar PhilETaylor
PhilETaylor - comment - 6 Mar 2022

Zero interest and now conflicts again.

avatar PhilETaylor PhilETaylor - close - 6 Mar 2022
avatar PhilETaylor PhilETaylor - change - 6 Mar 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-03-06 21:08:32
Closed_By PhilETaylor
Labels Added: Conflicting Files ?
Removed: ?

Add a Comment

Login with GitHub to post a comment