Conflicting Files ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
26 Jul 2021

Pull Request for Issue # .

Summary of Changes

This PR does two things:

  • Add $app property to plugins (when it is missing) and use that injected application object to replace Factory::getApplication()
  • Use $this->app->getIdentity() to get current user object instead of the deprecated method Factory::getUser();

Testing Instructions

Add it is small changes but target multiple plugins, I prefer to have careful code review here.

avatar joomdonation joomdonation - open - 26 Jul 2021
avatar joomdonation joomdonation - change - 26 Jul 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Jul 2021
Category Front End Plugins
avatar richard67 richard67 - change - 26 Jul 2021
Title
[4.0] Use getIdentify for plugins
[4.0] Use getIdentity for plugins
avatar richard67 richard67 - edited - 26 Jul 2021
avatar wilsonge
wilsonge - comment - 26 Jul 2021

I excludes system plugins from these changes because I'm unsure if it is safe to use $this->app->getIdentity() method in system plugins yet.

You've included a system plugin :D I'm also unsure though. Action logs (and user plugins) will also be loaded on update - hence why they get the extra warnings in the pre-update checker - so this probably does need a test unless you remove all of those cases

avatar joomdonation joomdonation - change - 27 Jul 2021
Labels Added: ?
avatar joomdonation
joomdonation - comment - 27 Jul 2021

You've included a system plugin :D I'm also unsure though

After looking at our Application classes more carefully, I see that the Identity is available very early in application life cycle. It is available in initialise phase, right after Factory::getUser() line is called https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Application/SiteApplication.php#L621 , long before system plugins are imported and triggered, so it is safe to use $this->app->getIdentity(); to get current logged in user.

With that said, I do the replacement in system plugins, too. Will test with update from Joomla 3.10 to 4.0 to make sure everything is still working OK.

avatar joomdonation
joomdonation - comment - 27 Jul 2021

So I tested the update from 3.10.0-dev to the package on PR and it is working OK. Tested several features in the CMS like login, logout, action logs, editor-xtds... changes by this PR and it is working OK, too.

avatar joomdonation joomdonation - change - 27 Jul 2021
The description was changed
avatar joomdonation joomdonation - edited - 27 Jul 2021
avatar wilsonge wilsonge - change - 20 Aug 2021
Labels Added: ?
Removed: ?
avatar HLeithner
HLeithner - comment - 27 Jun 2022

This pull request has automatically rebased to 4.2-dev.

avatar laoneo
laoneo - comment - 21 Oct 2022

Can you fix the conflicts here? Keep in mind that the service provider plugins have the app already injected. Would love to get this merged.

avatar joomdonation joomdonation - change - 29 Dec 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-12-29 15:14:06
Closed_By joomdonation
Labels Added: Conflicting Files ?
Removed: ?
avatar joomdonation
joomdonation - comment - 29 Dec 2022

There are so many conflicts now, so I'm closing this PR. Will review it at a later time base on latest code from plugins which we are having now.

avatar joomdonation joomdonation - close - 29 Dec 2022

Add a Comment

Login with GitHub to post a comment