modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 529 forks source link

OnUserAddToGroup does not appear to run #8317

Closed sean69 closed 5 years ago

sean69 commented 12 years ago

sean69 created Redmine issue ID 8317

I'm trying to execute a plugin on the OnUserAddToGroup event, but the event does not appear to ever run... Full thread is here: http://forums.modx.com/thread/78146/onuseraddtogroup-not-working#dis-post-430956

But my latest test:

Pretty convinced that the OnUserAddToGroup event does not run:

I put this in a plugin and set it to trigger on every UserGroups event:

$eventname = $modx->event->name;
$modx->log(modX::LOG_LEVEL_ERROR,'System event running = ' . $eventname);

I then tried adding a user to a group by every method I know of, editing the user in user manager, adding the user to a group under access controls & adding the user on the users tab while editing the group.

this is all I got:

 [2012-07-22 14:56:52] (ERROR @ /index.php) `[[+resource]]` is not a valid integer and may not be passed to makeUrl()
[2012-07-22 14:56:56] (ERROR @ /connectors/security/group.php) System event running = OnUserBeforeRemoveFromGroup
[2012-07-22 14:56:56] (INFO @ /connectors/security/group.php) Removed modUserGroupMember instance with primary key 213
[2012-07-22 14:56:56] (ERROR @ /connectors/security/group.php) System event running = OnUserRemoveFromGroup
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave
[2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave
[2012-07-22 14:58:44] (INFO @ /connectors/security/group.php) Removed modUserGroupMember instance with primary key 70

No OnUserAddToGroup .... the system event does not appear to run!

whitebyte commented 9 years ago

Still actual for 2.3.2 and 2.4.0-dev

pixelchutes commented 7 years ago

I can also confirm this in 2.5.2-dev.

The only reference I can find occurs in core/model/modx/processors/security/group/adduser.php -- still looking 🔍 into exactly how to get this event to fire...

This definitely feels like a bug, something that seems like it should run when creating/updating a user when adding them to new user group(s) just like your testing attempts would suggest.

GulomovCreative commented 5 years ago

The bug is solved.

MODX Revolution 2.7.0-pl