Language Change PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
16 Aug 2023

Pull Request for Issue #41374 .

Summary of Changes

log user block / unblock action

Testing Instructions

block / unblock users and check actionslog

In addition, check that editing a user still works.

Actual result BEFORE applying this Pull Request

User block / unblock action not logged.

Expected result AFTER applying this Pull Request

User block / unblock action logged.

Editing a user still works.

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

760eabf 16 Aug 2023 avatar alikon cs
avatar joomla-cms-bot joomla-cms-bot - change - 16 Aug 2023
Category Administration com_users Language & Strings Front End Plugins
avatar alikon alikon - open - 16 Aug 2023
avatar alikon alikon - change - 16 Aug 2023
Status New Pending
avatar Hackwar
Hackwar - comment - 16 Aug 2023

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()

avatar Hackwar
Hackwar - comment - 16 Aug 2023

We are also not logging when a user is deleted.

avatar alikon
alikon - comment - 16 Aug 2023

we are logging when a user is deleted

image

Why are you introducing these overly specific events?

cause they are specific different event imho

avatar Hackwar
Hackwar - comment - 16 Aug 2023

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.

avatar Hackwar
Hackwar - comment - 16 Aug 2023

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...

avatar alikon
alikon - comment - 16 Aug 2023

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"

414c3dd 16 Aug 2023 avatar alikon cs
avatar alikon alikon - change - 16 Aug 2023
Labels Added: Language Change PR-5.0-dev
9688e4c 16 Aug 2023 avatar alikon cs
avatar wilsonge
wilsonge - comment - 16 Aug 2023

Looking at the code I agree with Hannes.

avatar rdeutz
rdeutz - comment - 16 Aug 2023

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.

avatar alikon
alikon - comment - 16 Aug 2023

better onUserAfterSave ?

avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2023
Category Administration com_users Language & Strings Front End Plugins Administration Language & Strings Front End Plugins
1026c30 17 Aug 2023 avatar alikon cs
0a15e92 17 Aug 2023 avatar alikon lang
796ea3f 17 Aug 2023 avatar alikon cs
avatar Razzo1987
Razzo1987 - comment - 26 Aug 2023

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

image

avatar alikon
alikon - comment - 26 Aug 2023

@Razzo1987
as you have correctly stated the issue reported has nothing to do with this pr, something wrong happens on current 5 branch

avatar crommie crommie - test_item - 26 Aug 2023 - Tested unsuccessfully
avatar crommie
crommie - comment - 26 Aug 2023

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


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

avatar HLeithner
HLeithner - comment - 26 Aug 2023

@crommie it should work now

avatar rachelwalraven rachelwalraven - test_item - 26 Aug 2023 - Tested successfully
avatar rachelwalraven
rachelwalraven - comment - 26 Aug 2023

I have tested this item ✅ successfully on f1fc63d

On Joomla 5.0 with PHP 8.1


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

avatar crommie crommie - test_item - 26 Aug 2023 - Tested successfully
avatar crommie
crommie - comment - 26 Aug 2023

I have tested this item ✅ successfully on f1fc63d

It now works as described!


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

avatar richard67 richard67 - alter_testresult - 26 Aug 2023 - rachelwalraven: Tested successfully
avatar richard67 richard67 - alter_testresult - 26 Aug 2023 - crommie: Tested successfully
avatar richard67
richard67 - comment - 26 Aug 2023

@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?

avatar richard67
richard67 - comment - 26 Aug 2023

@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?

avatar crommie
crommie - comment - 26 Aug 2023

That wasn't in the instructions :).

And it indeed throws an error:

0 Class "Joomla\Plugin\Actionlog\Joomla\Extension\Factory" not found

avatar crommie
crommie - comment - 26 Aug 2023

Changes are applied though.

avatar richard67
richard67 - comment - 26 Aug 2023

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.

avatar richard67 richard67 - change - 26 Aug 2023
The description was changed
avatar richard67 richard67 - edited - 26 Aug 2023
avatar crommie
crommie - comment - 26 Aug 2023

So I don't need to retest? At least: not now?

avatar richard67
richard67 - comment - 26 Aug 2023

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.

avatar richard67
richard67 - comment - 26 Aug 2023

@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.

avatar richard67 richard67 - change - 26 Aug 2023
The description was changed
avatar richard67 richard67 - edited - 26 Aug 2023
avatar crommie
crommie - comment - 26 Aug 2023

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?

avatar crommie crommie - test_item - 26 Aug 2023 - Tested unsuccessfully
avatar crommie
crommie - comment - 26 Aug 2023

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.


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

avatar crommie
crommie - comment - 26 Aug 2023

Just ping me if you still need me to test on Monday.

avatar alikon
alikon - comment - 27 Aug 2023

@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

avatar crommie
crommie - comment - 27 Aug 2023

I can only test on PBF server site

avatar crommie crommie - test_item - 28 Aug 2023 - Tested unsuccessfully
avatar crommie
crommie - comment - 28 Aug 2023

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?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41377.
avatar brianteeman
brianteeman - comment - 28 Aug 2023

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

avatar crommie
crommie - comment - 28 Aug 2023

Nope. I had reverted all applied patches and fetched data again before trying to apply the patch.

avatar brianteeman
brianteeman - comment - 28 Aug 2023

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

avatar crommie
crommie - comment - 28 Aug 2023

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.

avatar alikon
alikon - comment - 29 Aug 2023

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 ?

avatar Razzo1987 Razzo1987 - test_item - 3 Sep 2023 - Tested successfully
avatar Razzo1987
Razzo1987 - comment - 3 Sep 2023

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:

  • icon in the users list
  • "actions" menu
  • the switch buttom in the user page

image

After patch the log report the action correcly:
image


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41377.
avatar HLeithner HLeithner - change - 4 Sep 2023
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-09-04 09:32:42
Closed_By HLeithner
avatar HLeithner HLeithner - close - 4 Sep 2023
avatar HLeithner HLeithner - merge - 4 Sep 2023
avatar HLeithner
HLeithner - comment - 4 Sep 2023

thanks

Add a Comment

Login with GitHub to post a comment