Posted by leafish_paul on March 31, 2009 at 7:35pm
Jump to:
| Project: | Role Weights |
| Version: | 6.x-1.x-dev |
| Component: | External module integration |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Views stuff needs a complete re-write for Drupal 6/Views 2.
Comments
#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.
#7
Couldn't get Views User Role support working like a lot of people using this module which is a shame because the 5.x version seemed perfect. I have found a work around for anyone wishing to use this functionality, http://drupal.org/project/user_badges
With this you can add badges to any role, and then order the badges by weight, allowing you to sort Views by badge weight. Personally, the use of badges being displayed wasn't important but the ability to display Views with Premium Role users' nodes first was great. Like I said, bit of a work around but works exactly as I'd hoped. I'm using this function on a Wedding directory based website (www.whiteweddingpages.co.uk) where users can pay for a better advertising listing depending on the role they purchase via Ubercart