Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
In Drupal 7 the FieldApi feature of Draggable Views does not work for several reasons:
* The field type `node_reference` changed to `node_reference_plain`
* The views field handler attribute changed from `real_field` to `field`
* The get function does not return the weight or the parent nid
Comment | File | Size | Author |
---|---|---|---|
draggableviews-field-api.patch | 2.25 KB | jantimon | |
Comments
Comment #1
mstrelan CreditAttribution: mstrelan commentedThis is more general than just Node References, although contains a fix for it. It is also critical as draggableviews functionality becomes very much broken. The patch works well for my situation, have not tested it with node references and have no idea what the get() function is for.
Comment #2
mstrelan CreditAttribution: mstrelan commentedOk I figured out the get function. The patch is awesome sauce. Please commit.
Comment #3
steinmb CreditAttribution: steinmb commentedNo commits, what is holding up this much needed patch?
Comment #4
spacereactor CreditAttribution: spacereactor commentedI can't make node references to work. Only manage to make the order of the field to draggable with FieldAPI, Node reference doesn't change with FieldAPI, it doesn't connect to parent node. What are the step take after apply the patch?
Can someone confirm with the above patch, does it work with node reference. Thank!!
Comment #5
jantimon CreditAttribution: jantimon commentedIn some cases the Node reference is not added to the view object and the above patch fails.
You might solve this by adding the Node reference into your "Sort criteria".
Comment #6
spacereactor CreditAttribution: spacereactor commented#5 doesn't work for me.
This is what i got, create two node content. "Parent" & "Child" content type. Both have new Integer field call "weight" and "Child" content type has a node reference field call "Parent Reference". Create a views page.
Format Draggable Table
- Order = Weigth / FieldAPI
- Parent = Parent Reference / FieldAPI
- Define the depth limit: -1
Field
- DraggableViews: Order
- DraggableViews: Parent
- Content: Weight
- Content: Parent Reference
- Title
Filter Criteria
- Content: Published
- Content: Type (in Parent, Child)
Sort Criteria
- Content: Weight
- Content: Parent Reference
Comment #7
ts145nera CreditAttribution: ts145nera commentedPatch work for me.
Great work
Thanks
Comment #8
ygerasimov CreditAttribution: ygerasimov commentedcommitted. thanks!
Comment #9
ygerasimov CreditAttribution: ygerasimov commentedforgot to change status of the issue
Comment #11
dboulet CreditAttribution: dboulet commentedThe tip in #5 helped to make the node hierarchy appear correctly in my view, but this is still not working properly for me—new parent values are not saved to the node reference fields when I save the form. I’ve create a new issue to deal with these reference-specific problems: #1242382: Node reference integration not working.