[com_actionlogs] - fix non object notice#22526
[com_actionlogs] - fix non object notice#22526wilsonge merged 1 commit intojoomla:stagingfrom alikon:patch-94
Conversation
|
I have tested this item ✅ successfully on 49778af This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22526. |
1 similar comment
|
I have tested this item ✅ successfully on 49778af This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22526. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22526. |
|
Folks, please test #22518 |
| protected function addLog($messages, $messageLanguageKey, $context, $userId = null) | ||
| { | ||
| $user = $this->app->getIdentity(); | ||
| $user = JFactory::getUser(); |
There was a problem hiding this comment.
Just wondering if we have a bug here? Why is getIdentity null?
There was a problem hiding this comment.
For 3.x? Because loadIdentity is not consistently called.
There was a problem hiding this comment.
So this needs to be fixed then. As far as I know in 4 it works reliably.
There was a problem hiding this comment.
There was a specific fix for that in 4.x we always call it early in the stack to ensure it's loaded (#16398). It's not something I'd feel comfortable porting back into 3.x because it might well affect anything that extends CMSApplication
There was a problem hiding this comment.
Actually it got fixed in #19766. It would make sense to port it back to 3 or not?
There was a problem hiding this comment.
Well then is #16398 actually doing anything. Because that should have been enough on it's own
If we do backport it would have to be 3.10 and would need some heavy testing because it might well have affects on things that extends CMSApplication (i know when michael made it a final class some people complained and it ended up being reverted so there are definitely people doing that)
There was a problem hiding this comment.
It is more involved than those two patches. You're going to have to dig back even deeper to when the session API was refactored to use the Framework.
Pull Request for Issue #22525
Testing Instructions
see #22525
Expected result
no notice
Actual result
PHP error log
PHP Notice: Trying to get property 'id' of non-object