• msteel

    (@msteelnapcocom)


    I’ve been getting the following warning on user edit pages.

    Warning: in_array() expects parameter 2 to be array, string given in /.../wp-content/plugins/edit-flow/modules/user-groups/user-groups.php on line 1046

    I decided to wipe out the user groups to get past this for now but when i saved I got an error about having no user groups.

    For now I updated user-groups.php to have a check:

    if ( is_array( $all_usergroups ) && count( $all_usergroups ) ) foreach( $all_usergroups as $usergroup ) {
      if ( in_array( $usergroup->term_id, $usergroups ) )
        $this->add_user_to_usergroup( $user->ID, $usergroup->term_id );
      else
        $this->remove_user_from_usergroup( $user->ID, $usergroup->term_id );
    }

    I have not had a chance to see if this is because of some other plugin, etc. but it seems to me it would be best to have these kinds of checks baked in.

    https://ww.wp.xz.cn/plugins/edit-flow/

Viewing 1 replies (of 1 total)
  • Thread Starter msteel

    (@msteelnapcocom)

    Follow Up:
    Even with no other plugins active I still get the errors. The errors on saving are:

    Warning: Invalid argument supplied for foreach() in /.../wp-content/plugins/edit-flow/modules/user-groups/user-groups.php on line 1011
    
    Warning: array_unique() expects parameter 1 to be array, string given in /.../wp-content/plugins/edit-flow/modules/user-groups/user-groups.php on line 903
Viewing 1 replies (of 1 total)

The topic ‘Errors when there are no groups or when groups have no users’ is closed to new replies.