Hi there,
Client has me adding to your module the ability to select users by role. Seems like a worthy addition and with your cool hooks i was able to do all of it outside of your module (which is the whole idea behind Drupal!!). Took me about 2 hours and i had it done... but i noticed that i think there is a change required to your module to make this work.. and don't see a down side anywhere.
Since a user can belong to numerous roles and although i don't claim to be a mysql expert.. i don't think there is a way via where and joins that i pass through your hooks to get only a unique set of users - in other words if a user belongs to 2 roles and i select both those roles; then i get him listed twice.
I think adding a DISTINCT to your SELECT like this (on line 392):
$sql = 'SELECT DISTINCT cd.uid as uid_key, ' . implode(', ', $select_columns) . ' '
will fix this and possibly fix similar issue for others doing other types of queries; plus pretty sure no down side to this.
Peter Lindstrom
LiquidCMS - Content Management Solution Experts
Comments
Comment #1
pukku commentedDone — thanks for the fix!
Comment #2
pukku commented