Closed (fixed)
Project:
DraggableViews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2011 at 11:43 UTC
Updated:
21 Apr 2011 at 20:51 UTC
Moving http://drupal.org/node/1025128#comment-4244142 here:
I have ported CCK handler. Here is patch that enabled FieldAPI handler and now draggable views can be used with integer weight field. I haven't tested any other functionality.
I have removed ^M symbols in draggableviews.module file.
Patch is against 7.x-1.x branch.
| Comment | File | Size | Author |
|---|---|---|---|
| ygerasimov-fieldapi-handler.patch | 41.22 KB | ginc |
Comments
Comment #1
ginc commentedGenerates this error on edit views page:
Display "Defaults": Draggableviews: You must sort by Fields: field_name_of_integer_weight_field ascending as the first sort criteria to display the structure correctly.
Comment #2
ginc commentederror generated by line #77-79 in draggableviews_plugin_style_draggabletable.inc:
Comment #3
ygerasimov commentedThis message is made by design. If you create a draggable view and set up some field as 'order' field, then view should be sorted by this field by default. This is what this message advises.
@GA please advise whether you still have any questions about this?
Comment #4
ginc commentedit gives the error even when u r actually sorting the way required by design.
views: 7.x-3.0-alpha1
references: 7.x-2.x-dev-2011-Feb-25
Comment #5
ygerasimov commentedOK. I have tested again and everything worked without this error.
1. Clean installation of drupal. Clone of draggable views 7.x-1.x. Apply patch above.
2. Add field weight (integer, one value only, text field as widget) to basic page content type
3. Create a view with display page and style draggble table. Fields: title, weight. In draggable table style settings select weight as order field and fieldapi as handler. uncheck "repair broken structures". Add sort criteria by field weight ascendling.
4. Create couple of nodes. Do not assign any weight. Try to sort them on the page with draggable table.
Please view http://www.youtube.com/watch?v=bUxyqrMU_NY
Please confirm you were able to set up everything properly.
Comment #6
dmsmidtI tried your approach. With views, & ctools (dev 25 march), draggableviews (dev 25 feb)
First I get a patch error:
Giving the file manually, looks like it works.
Making the view results in this error: Draggableviews: Handler fieldapi could not be found.
When I copied draggableviews_handler_fieldapi.inc to the implementations folder it worked.
The "Show row weights" option doesn't really show the actual weight values though.
So it almost works! Thnx good work so far
Offtopic: Now I tried to make this work for a file type view.. but now I get the Sort error. Removing the sort check from the module gives me a nice view. But it just doesn't want to store the values. (Created this issue: http://drupal.org/node/1104260)
Comment #7
ginc commentedi suggest to get this patch to the development branch as it doesn't break anything that worked before (according to my tests), that makes it easier for others to help testing it. what do u think?
Comment #8
ygerasimov commentedSurely. I will commit this patch to 7.x-1.x-dev then.
Comment #9
ygerasimov commentedcomitted to 7.x-1.x
Comment #10
dboulet commentedLooks like part of the code committed here caused this issue: #1111398: Draggableviews: You must sort by DraggableViews: Order ascending as the first sort criteria to display the structure correctly..