May 24, 2013

WordPress Plugin Editflow: User groups not selected on edit user page

WordPress Plugin Editflow 0.7.6: User groups not selected on edit user page

User ids array was being empty on wp-admin/network/users.php. I created a user group through editflow -> user groups, selected users and updated. It was working fine but when i tried to edit a specific user, checkbox(es) were not checked. It was working fine when i used usergroups through editflow section but when there are multiple groups iterated on wp-admin/network/user-edit.php so there was a problem.
I have checked the code and reported to Edit Flow about the problem.

Finally I found the problem and fixed it for myself at least. My client was using WP Engine hosting, when i was in staging environment so everything was working fine. But when i moved the code to the live site and checked the edit user page, assigned group(s) were not checked.
Correction made on line no. 833 in the file modules/user-groups/user-groups.php.

Fix:

$usergroup->user_ids = !isset($usergroup->user_ids)?array():$usergroup->user_ids;

Thanks,
Fahad

Last updated: March 19, 2014