? ? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
8 Jun 2022

Summary of Changes

Use the app identity in the FormController.

When the controller needs a current user, it must be set in the MVCFactory. This is the case on all Form based controllers.

Testing Instructions

  • Log in on the back end
  • Go to the articles manager
  • Click on New
  • Give the article a title
  • Save the article

Actual result BEFORE applying this Pull Request

All works.

Expected result AFTER applying this Pull Request

All works.

avatar laoneo laoneo - open - 8 Jun 2022
avatar laoneo laoneo - change - 8 Jun 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2022
Category Libraries
avatar toivo toivo - test_item - 9 Jun 2022 - Tested successfully
avatar toivo
toivo - comment - 9 Jun 2022

I have tested this item successfully on cf172a9

Tested successfully in Joomla 4.2.0-beta1-dev of 9 June using Wampserver 3.2.9 and PHP 8.0.15


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

avatar laoneo laoneo - change - 9 Jun 2022
Labels Added: ?
avatar joomdonation
joomdonation - comment - 9 Jun 2022

In controller, we can already access to current user object via $this->app->getIdentity(); . Could you please explain the reason for injecting it again when controller is created using MVCFactory?

avatar laoneo laoneo - change - 9 Jun 2022
The description was changed
avatar laoneo laoneo - edited - 9 Jun 2022
avatar laoneo laoneo - change - 9 Jun 2022
Title
[4.2] Set the app identity on the controller in the factory
[4.2] Use the app identity in the FormController
avatar laoneo laoneo - edited - 9 Jun 2022
avatar laoneo
laoneo - comment - 9 Jun 2022

YOu are right, changed the code to use the identity.

avatar joomdonation joomdonation - test_item - 9 Jun 2022 - Tested successfully
avatar joomdonation
joomdonation - comment - 9 Jun 2022

I have tested this item successfully on 4a36bde


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

avatar joomdonation
joomdonation - comment - 9 Jun 2022

@laoneo Unrelated to this PR but you made similar check here https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/MVC/Controller/BaseController.php#L598 and here https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/MVC/Controller/BaseController.php#L630 in PR #37498 . The check $this->app->getIdentity() in these lines could be removed, too.

avatar laoneo
laoneo - comment - 9 Jun 2022

Can you make a pr removing them?

avatar chmst chmst - test_item - 9 Jun 2022 - Tested successfully
avatar chmst
chmst - comment - 9 Jun 2022

I have tested this item successfully on 4a36bde


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

avatar chmst chmst - change - 9 Jun 2022
Status Pending Ready to Commit
avatar chmst
chmst - comment - 9 Jun 2022

RTC


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

avatar roland-d roland-d - change - 12 Jun 2022
Labels Added: ?
avatar roland-d roland-d - close - 12 Jun 2022
avatar roland-d roland-d - merge - 12 Jun 2022
avatar roland-d roland-d - change - 12 Jun 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-12 10:04:18
Closed_By roland-d
avatar roland-d
roland-d - comment - 12 Jun 2022

Thanks everybody

Add a Comment

Login with GitHub to post a comment