Viewing 4 replies - 1 through 4 (of 4 total)
  • We have/had this same issue. It took me ages to figure out why people were being taken out of groups!

    I have made a small edit to the plugin as a workaround if you’re interested:

    Find:

    /* Update the user groups when the edit user page is updated. */
    		add_action( 'personal_options_update', array(&$this, 'save_user_user_groups'));
    		add_action( 'edit_user_profile_update', array(&$this, 'save_user_user_groups'));

    And replace with:

    /* Update the user groups when the edit user page is updated. */
    		if(current_user_can('edit_users')) {
    		add_action( 'personal_options_update', array(&$this, 'save_user_user_groups'));
    		add_action( 'edit_user_profile_update', array(&$this, 'save_user_user_groups'));
    		}

    Thanks obsessedwithfilm!
    Your solution worked perfectly, it was driving me nuts resetting the usergroups over and over!

    this workaround is good and drastic but the error came from update save function (save_user_user_groups): see below fixed code

    /* Make sure the current user can edit the user and assign terms before proceeding. */
    		if ( !current_user_can( 'edit_user', $user_id ) || !current_user_can( $tax->cap->assign_terms, $user_id ) ) {
    			return false;
    		}

    cap->assign_terms is preset to read… I set it to edit_user

    M.

    Plugin Author Zack Katz

    (@katzwebdesign)

    Thanks, I’ll add this to the next release.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User group unchecked as profile edit’ is closed to new replies.