Improve Views support
leafish_paul - March 31, 2009 - 19:35
| Project: | Role Weights |
| Version: | 6.x-1.x-dev |
| Component: | External module integration |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Views stuff needs a complete re-write for Drupal 6/Views 2.

#1
I'm prepared to pay for the Role Weights update to 6.x to sort in views (via www.moneybookers.com) as follows:
The way it worked in 5.x was you were able to edit roles at admin/user/roles and set their weight.
Then in views you were able to sort the view by role weight in 'sort criteria'.
Basically I could have my highest roles show first in the view, then second, etc. It is for a member directory.
Would so much appreciate this capability and so important to my views.
Look forward to any suggestions, and again, thank you.
Lilian
#2
* sorry for the bump * have to sort in views by role please :)
#3
#4
Limited Views functionality equivalent to that in 5.x-1.5 added. Room for much improvement. #64071: Views support: when sorting by role weights a node appears three times. also needs addressing in both 5.x/6.x branches.
#5
The biggest problem currently is that in joining the base
nodeoruserstable torole_weightsviausers_roles, we create duplicates when users have more than one role (other than anonymous/authenticated).After rummaging around Views docs and code, the same problem occurs in Views taxonomy support. Create a simple, new node view showing nodes with more than one term, sorted by Term ID. Duplicates appear for each node with more than one term.
So how to tackle this? I'm going to shout out on the Views dev group at some point soon, just noting some thoughts down now.
Currently looking at maintaining a
{role_weights_max}table, which would store:|-------------------------|| role_weights_max |
|-------------------------|
| uid |
| lightest_role_weight |
| heaviest_role_weight |
|-------------------------|
and could be updated when a user's roles are modified, or role weights themselves are changed. With this table maintained, the Views join is much simpler and we can provide simple fields for Lightest/Heaviest Role Weight, for sorting at least.
#6
EDIT: Nevermind, brain fart on my part looking at the query wrong.