User tests: Successful: Unsuccessful:
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.
All works.
All works.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
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?
Title |
|
YOu are right, changed the code to use the identity.
I have tested this item
@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.
Can you make a pr removing them?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
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 |
Thanks everybody
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.