joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.2] Fix of backward compatibility for Login event arguments

Open Fedik opened this issue 1 year ago • 3 comments

Pull Request for Issue # .

Summary of Changes

This is fix for extensions which triggers onUserAfterLogin, onUserAfterLogout, onUserLoginFailure, onUserLogoutFailure events in their code. Prior Joomla 5 these events had 1 argument, with Joomla 5 they have 2 arguments, to be consisten with onUserLoginEvent and onUserLogiutEvent events.

Testing Instructions

Add following code, in to index.php of the template:

$e1 = new \Joomla\CMS\Event\User\AfterLoginEvent('onFooBar', [['option' => 1]]);
$e2 = new \Joomla\CMS\Event\User\LoginFailureEvent('onFooBar', [['user' => 1]]);
$e3 = new \Joomla\CMS\Event\User\LogoutFailureEvent('onFooBar', [['user' => 1]]);
dd($e1, $e2, $e3);

Actual result BEFORE applying this Pull Request

An error page.

Expected result AFTER applying this Pull Request

Dump of event objects, on blank page.

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:
  • [ ] No documentation changes for docs.joomla.org needed
  • [ ] Pull Request link for manual.joomla.org:
  • [ ] No documentation changes for manual.joomla.org needed

Fedik avatar Aug 17 '24 09:08 Fedik

I have tested this item :white_check_mark: successfully on 0cfd1205f84a557967e755ab34d134e0a3b663e1


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

ghost avatar Aug 17 '24 10:08 ghost

I have tested this item :white_check_mark: successfully on 0cfd1205f84a557967e755ab34d134e0a3b663e1


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

viocassel avatar Aug 17 '24 21:08 viocassel

RTC


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

Quy avatar Aug 17 '24 21:08 Quy

Thank you for your contribution @Fedik!

Hackwar avatar Sep 11 '24 21:09 Hackwar