Thanks for creating this module...

I want to use DV to order a list of referenced nodes using the Entity Reference module. I have created a view which displays the Title, NID and Draggable Weight, all using the "referenced nodes" relationship. This page works and I can save the order. Looking via PHPMYADMIN the order appears to save too.

However, the problem comes when trying to apply the sort. If I add "Draggableviews: Weight" to the sort and use the relationship I get the following error: -

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node_field_data_field_referenced_nodes__draggableviews_structure' in 'order clause'

So the questions are, can I use DV to sort entity references, and if so, how?

Comments

istryker’s picture

First, please give the full mysql query

FYI - you can turn this on by going to Admin -> Structure -> Views -> Settings (settings is a tab) -> Check off " Show the SQL query "

dqd’s picture

obrienmd’s picture

Very interested in this as well.

istryker’s picture

cross referencing - @wizonesolutions comment

Note that this is not a duplicate of #1867908: Field API: Support Entity Reference. This one is about using Draggableviews for content pulled in via an Entity Reference relationship. That one is about using Entity Reference fields to store and determine the hierarchical order in the view.

istryker’s picture

The error message about the 8nknown columns relates to #1787764: Unknown column caused by orderby alias not matching field alias

merilainen’s picture

I get an AJAX error when trying to add the weight to the display view

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /en/admin/structure/views/ajax/config-item/view_name/block_4/sort/weight
StatusText: Service unavailable (with message)
ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7633 of /Users/username/Sites/sitename/includes/common.inc).
merilainen’s picture

The problem seems to affect the native handler. I added a "order" integer field to the content type and used the FieldAPI handler using that order field for sorting, then it works well.

dobe’s picture

Please check out my patch at https://drupal.org/node/1879408 I am currently using it in production for entity reference parent's

istryker’s picture

Issue summary: View changes
istryker’s picture