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

CommentFileSizeAuthor
draggableviews-field-api.patch2.25 KBjantimon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mstrelan’s picture

Title: Can't use FieldApi for Views 3 RC 1 and Node References » Can't use FieldAPI for Views 3 RC 1
Priority: Normal » Critical

This 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.

mstrelan’s picture

Status: Needs review » Reviewed & tested by the community

Ok I figured out the get function. The patch is awesome sauce. Please commit.

steinmb’s picture

No commits, what is holding up this much needed patch?

spacereactor’s picture

I 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!!

jantimon’s picture

In 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".

spacereactor’s picture

#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

ts145nera’s picture

Patch work for me.
Great work
Thanks

ygerasimov’s picture

committed. thanks!

ygerasimov’s picture

Status: Reviewed & tested by the community » Fixed

forgot to change status of the issue

Status: Fixed » Closed (fixed)

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

dboulet’s picture

The 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.