I have a plugin that does a little work after a user has been saved in the CP based on the user groups they are in.

The $event->params['user'] object seems to be partially up to date when the event is handled. The username and general info is the recently entered values, however the groups is not current, it is always what is was before

  • I did a little extra digging, if I kill the function that is handling the onSaveUser event and check the database the craft_usergroups_user table is showing the 'old' values, not the values that were just posted. Commented Aug 26, 2014 at 21:18
  • 1
    There is a known issue regarding the $_POST['groups'] value, and the order in which it's processed. This answer from another question addresses a slightly different situation, but may help you solve your problem.
    – Lindsey D
    Commented Aug 26, 2014 at 23:12
  • Thanks @LindseyD. I ended up checking the groups array in the post to see if the correct value was there $groups = craft()->request->getPost('groups'); Commented Sep 5, 2014 at 13:51
  • I'm voting to close this question as off-topic because it sounds like a bug that you hit and you aren't posing a specific question. Feel free to clarify if this isn't the case. Commented Feb 20, 2015 at 1:05


Browse other questions tagged or ask your own question.