Use role ID in URL instead of the name of the role

csc4 - November 20, 2006 - 17:15
Project:User List
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm getting multiple entries for users by content type - should there be a distinct on the SQL statement at line 67?

    $result = pager_query("SELECT DISTINCT u.uid, u.name FROM {users} u INNER JOIN {node} n ON n.uid = u.uid AND n.type = '%s' WHERE u.status != 0 AND u.access != 0 ORDER BY u.name ASC", $number, $element, NULL, $content_type);

#1

aaron - November 30, 2006 - 18:45

yes. USE THE HEAD version of this module! i fixed that awhile ago, but am unable to commit to the 4.7 branch of this module. i'm really, really sorry about that, and will have to find someone to help me figure out how to cvs this properly (using eclipse, if anyone is watching).

#2

csc4 - December 8, 2006 - 18:17

Ah - the head version is much better - thanks!

Did spot a tiny typo at line 126 - lost the t in currently

More significantly, the role listing doesn't seem to be working for me. It correctly shows me the list of roles (six in my case) I've selected the bottom option writers_member which it highlights but it then uses administrator in the example below and if I take userlist/roles/writers_member it says There are currently no users with a role. Looking at the code line 102 it seems %role is empty. The problem is line 545 replaces _ with space! commenting that out fixes it for me but obviously wouldn't if the _ was a placeholder for a role with a space in it.

It would also be really really great if the listing of people with a content type could add a link to the list of that content type rather than having to go via their profile...

#3

aaron - December 8, 2006 - 19:38

the issue is how to take care of spaces for url's, and to make sure the role in the url translates back to a space. perhaps we should just use rid rather than the role name, or translate them to + or something else. (or whatever space normally translates to, %32 or whatever).

i'll give it some thought & test it another time. if someone else has a suggestion, feel free to comment!

#4

deekayen - May 6, 2008 - 16:24
Title:User List - Duplicate entries in /content/type» Use role ID in URL instead of the name of the role
Version:4.7.x-1.x-dev» HEAD
Category:bug report» task

This is also an issue for roles that have a forward slash that gets interpreted as an argument divider by clean URLs parsing. See: http://drupal.org/node/104839

 
 

Drupal is a registered trademark of Dries Buytaert.