Sort User Profiles

theoldfather - July 31, 2009 - 18:39
Project:DraggableViews
Version:6.x-3.2-beta5
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I have been very pleased without draggableviews. It works as expected with regular nodes. However, I need to be able to sort users. The view seems to display correctly, but it won't sort and save. I can see from the code that this is because it only looks for nid's in the view object.

I have started writing a patch which will include a new handler for sort User Profile. If there is a simpler way for me to go about this, let me know. But from what I see it will require a little coding to accommodate.

#1

sevi - July 31, 2009 - 20:35

I would prefer modifying the existing handler to support all kinds of base tables. I think replacing the hard-coded "nid" with the varying base-table-ID (nid, uid, tid,..) should do it.
Unfortunately i'll not find time to work on this until the 10th of august. Maybe someone else?

Greetings,
sevi

#2

theoldfather - July 31, 2009 - 21:26

I've been working on this for the past couple hours, but haven't gotten very far. Are you saying it would be possible to do all the coding necessary simply by modifying the draggableviews_handler_ class? It seems like there are a lot of changes that would need to take place in draggableviews.inc.

#3

sevi - August 14, 2009 - 23:20
Status:active» needs review

This patch provides draggableviews support for the base tables "users", "node_revisions", "node", "comments".
Primarily the patch changes $node->nid to $node->{$view->base_field}.
While we're at it I changed some comments and little code too (don't be confused).

Known bugs so far: The expand/collapse javascript doesn't work if the Anonymous user is listed in the view because it owns the critical user-ID 0.

Caution: This patch may cause loss of already saved structure information. The internal names of the views fields "Draggableviews: Order" and "Draggableviews: Parent" changed, so you have to re-add them to the view as well as you have to reconfigure the style-plugin (the order/parent field). Also the sort criteria must be re-configured.

The patch works for me. Hope it works for you too :)

Greetings,
sevi

(I'm not sure if you can use this patch because it contains the changes of many files. I don't have any experience with such patches.)

AttachmentSize
draggableviews-536846.patch 17.43 KB

#4

sevi - September 14, 2009 - 21:40
Status:needs review» fixed

This patch is part of DraggableViews since 6--3-2-BETA6. (The current version is 6--3-3-BETA1)
The status "needs review" lost its sense.
Reopen a new issue if you encounter any problems.

Greetings,
sevi

#5

System Message - September 28, 2009 - 21:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.