Please upgrade here. These earlier versions are no longer being updated and have security issues.

user list shows a lot of duplicate users

This discussion is related to the User List addon.
horia_mhoria_m New
edited February 2011 in Vanilla 2.0 - 2.8
Hi,
I just installed 2 days ago vanilla and your plugin.
The list of users shows duplicate users, so that instead of abut 7 it shows about 20.
can this be fixed?
(my version of the plugin is very recent)
thank you!

Comments

  • Noone around here?

    I checked the database, and there are no duplicate users there (in the "Users" table that i found). So, why is this happening?
  • I have also had this problem. I guess some people have just seen what it does and then just take the plugin out. :-/

    Gonna have a quick look now to see if I can actually fix anything. I'll post in a little while.
  • Found the issue. What the plugin does, and this is just a guess, but it looks through all the roles and then returns the names in each role. So, this means that if you have one user in two roles, it will return the user twice.

    This might be because you have some users listed as a member AND Admin, or Mod. Something like that.

    This really is a problem as it means a messy database with too many Roles. For the moment, just take the member role away from anyone that has a second role. That should fix it.
  • Just installed and found the same issue. I have all my users in two or more roles, so every single user is at least doubling up. That's no good.
  • @Gig: thank you for explaining the bug! I'll see if turning off some roles does not affect the functionality for those users.
  • /plugins/UserList/class.userlistmodule.php
         $this->Users = $SQL
    ->Distinct() // add
    ->Select($Select)
    ->From($From)
    ->Join('UserRole r','u.UserID = r.UserID')
    ->Where($Where)
    ->Get();

    $this->All_Users = $SQL
    ->Distinct() // add
    ->Select('u.UserID')
    ->From('User u')
    ->Join('UserRole r', 'u.UserID = r.UserID')
    ->Where(array('u.Deleted'=>0,'r.RoleID>'=>7))
    ->Get();
    White
  • thank you, yu_tang! That's great. I will use this code.
  • I tested it, and it works well now! Thank you again, yu_tang!
Sign In or Register to comment.