On "Editorial assignments by editor" screen, I can see that 2 editors are linked to a section, and when I click on the link, only one user is there. It's because the user has 2 roles that are both affected to the section, so

 $count = db_query("SELECT COUNT(wau.uid) FROM {workbench_access_user} wau
          INNER JOIN {users_roles} ur ON wau.uid = ur.uid
          WHERE wau.access_scheme = :access_scheme AND wau.access_id = :access_id
          AND ur.rid IN (:rids)",
          array(':access_scheme' => $active['access_scheme']['access_type'], ':access_id' => $access_id, ':rids' => array_keys($roles)))->fetchField();                                                                                                                  

(in workbench_access_editors()) returns "2" because of the user_roles JOIN.
I'd put a DISTINCT immediately before wau.id, but I forgot if it's totally cross-database or not...

CommentFileSizeAuthor
#2 1243898-distinct.patch671 bytesagentrickard

Comments

agentrickard’s picture

Status: Active » Needs work

Good catch.

agentrickard’s picture

Status: Needs work » Fixed
StatusFileSize
new671 bytes

Committed.

(And yes, DISTINCT is fine in db_query()).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.