User tests: Successful: Unsuccessful:
Pull Request for Issue #41374 .
log user block / unblock action
block / unblock users and check actionslog
In addition, check that editing a user still works.
User block / unblock action not logged.
User block / unblock action logged.
Editing a user still works.
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
Category | ⇒ | Administration com_users Language & Strings Front End Plugins |
Status | New | ⇒ | Pending |
We are also not logging when a user is deleted.
I have to see why it doesn't log that in my case. However block/unblock are only differentiated by the block flag and that is something that you can also do in the normal onUserAfterSave event. Introducing a new event here is wrong.
Great, Easy Profile in Joomla 3 is blocking the logging of deleted users... Good thing I'm migrating away from that with the move to J4...
Introducing a new event here is wrong.
that's your opinion
furthermore
When you block/unblock users from users list using the Actions there is no "onUserAfterSave event"
Labels |
Added:
Language Change
PR-5.0-dev
|
Looking at the code I agree with Hannes.
As @Hackwar already wrote you can do this in the beforeUserSave Event, specific events for this case seems over engineered. Maintenance team decided not to go the way of creating new events for this case. Please change the PR and use existing events, logging block/unblock is a good idea.
better onUserAfterSave
?
Category | Administration com_users Language & Strings Front End Plugins | ⇒ | Administration Language & Strings Front End Plugins |
Hi, we have tested it with the italian team during PBF.
Before appling patch the block/unblock the user trown an error:
Joomla\CMS\Event\User\AfterSaveEvent::setErrorMessage(): Argument #1 ($value) must be of type string, null given, called in C:\wamp\www\joomla5\libraries\src\Event\AbstractEvent.php on line 205
@Razzo1987
as you have correctly stated the issue reported has nothing to do with this pr, something wrong happens on current 5 branch
I have tested this item ? unsuccessfully on bc1ce49
Without patch:
0 Joomla\CMS\Event\User\AfterSaveEvent::setErrorMessage(): Argument #1 ($value) must be of type string, null given, called in /var/www/html/libraries/src/Event/AbstractEvent.php on line 205
User status is changed.
Action is not in Action Logs.
(After applying patch #41464 message is gone and user status is changed.)
After applying patch:
Class "Joomla\Plugin\Actionlog\Joomla\Extension\Factory" not found
User status not changed
Action not in Action Logs
I have tested this item ✅ successfully on f1fc63d
On Joomla 5.0 with PHP 8.1
I have tested this item ✅ successfully on f1fc63d
It now works as described!
@HLeithner System tests are failing when trying to edit a user, and I think it could be related to this PR, or at least be a side effect. Do you have an idea what could go wrong?
@rachelwalraven @crommie Have you tested by blocking the user with the icon in the list view? If so, could you check in addition if editing a user still works?
That wasn't in the instructions :).
And it indeed throws an error:
0 Class "Joomla\Plugin\Actionlog\Joomla\Extension\Factory" not found
Changes are applied though.
That wasn't in the instructions :).
And it indeed throws an error:
0 Class "Joomla\Plugin\Actionlog\Joomla\Extension\Factory" not found
Thanks for checking. That was faster than me setting up my environment. I found the reason, and this PR needs to be fixed. Not sure yet what's the best way.
So I don't need to retest? At least: not now?
So I don't need to retest? At least: not now?
Not now. I've updated testing instructions. Let's see what @HLeithner responds to my question in my review comment.
@rachelwalraven @crommie Now it's ready to be tested again. Could you test with the latest changes, i.e. when using Patchtester revert any patches, then fetch the list of pull requests again and then apply this pull request? Please also not the updated testing instructions. Thanks in advance, and thanks for the many other tests today at the PBF event.
We're both on the train right now, so not able to test again. @rachelwalraven you can test again tomorrow, right? I can't test until Monday. Will the PBF server sites still be available then?
I have tested this item ? unsuccessfully on 1716442
Partly succes, partly not.
Changing user from the list throws
0 Joomla\CMS\Event\User\AfterSaveEvent::setErrorMessage(): Argument #1 ($value) must be of type string, null given, called in /var/www/html/libraries/src/Event/AbstractEvent.php on line 205
(Ihad applied the patch #41464 for that, but this is merged so no longer in the patch list since I've re-fetched the data)
Action is performed. Actions log doesn't show the action.
Changing user from the user view doesn't throw the error. Action is performed. Action log shows the action.
Just ping me if you still need me to test on Monday.
@crommie @rachelwalraven @Razzo1987
if you can please re-test use the nigthly build or the Prebuilt package
p.s.
Will the PBF server sites still be available then?
not sure maybe @bembelimen can better answer your question
I can only test on PBF server site
I have tested this item ? unsuccessfully on 3dd7b4b
I've updated the PBF server site with the update package from today, could it be that editing a user and recording this in action logs already works in this package so this patch isn't necessary anymore?
Because I had no trouble performing the action and seeing it recorded before applying the patch. When I tried to apply it (just to see if that was possible at all), it threw:
The patch could not be applied because it conflicts with a previously applied patch: administrator/language/en-GB/plg_actionlog_joomla.ini
So I guess this is fixed?
The patch could not be applied because it conflicts with a previously applied patch: administrator/language/en-GB/plg_actionlog_joomla.ini
That means that your test server already has A patch applied
You will need to reset the patchtester
Nope. I had reverted all applied patches and fetched data again before trying to apply the patch.
Nope. I had reverted all applied patches and fetched data again before trying to apply the patch.
I am only explaining what the error message means. Try another server maybe that one is confused
Thanks for the explanation Brian, but the instruction was:
if you can please re-test use the nigthly build or the Prebuilt package
Doesn't that rule out the other PBF server sites? Since they were all configured before the nightly builds?
Anyway. Functionality works as should. Patch can no longer be applied, at least not on the test site I used.
i can only restate what i've already wrote
for a proper test
use the nightly build or the Prebuilt package
i don't have any control on the PBF servers
sorry for that ?
I have tested this item ✅ successfully on 3457bdc
Tested on Joomla_5.0.0-beta1 nightly (Sunday, 03 September 2023 00:17:07 UTC
Before the patch
ID 6 is user creation,
the next 6 logs is disable & Enable from:
After patch the log report the action correcly:
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-09-04 09:32:42 |
Closed_By | ⇒ | HLeithner |
thanks
Why are you introducing these overly specific events? We already have onBeforeUserSave and onAfterUserSave. I don't think it is necessary at all to add yet another event just for this feature. Especially since all third party extensions which do this (like Community Builder for example) would have to implement that event as well instead of just triggering the already existing events when doing a $user->save()