I have a content type with a field of type "Entity reference" and widget "Inline entity form - Multiple values". I create a node, add multiple entities, drag to rearrange the order of entities, but I can't seem to reflect this order / weightings in my view.

I create a view with relationship "Entity Reference: Referencing entity" and list my entities fields. The only "sort" criteria available that makes any sense is "field_myentities:delta" with the parent node relationship, but using that in sort results in each entity being output twice, and if I use it in fields then each duplicate result has a different delta anyway.

How can I replicate the drag and drop weighting / order of entity references in my view output?

Comments

lucas.constantino’s picture

Same problem here :(

justaman’s picture

same here, I tried to remove duplicates http://drupal.stackexchange.com/questions/38450/drupal-7-views-how-to-re... but it does not work for me. If I try the aggregation fix which I consider overwork, all items disappear.

csedax90’s picture

Same problem... nobody says how to solve?

tostinni’s picture

To keep the order of those items in views, you need to use the delta sort criteria.

Joao Sausen’s picture

Using the delta criteria in the sort order returns duplications

Drupal8’s picture

I have the same effect, with the use of the delta sort criteria only to include duplicates. I just remove the sort criteria from the view and this seems to work as expected. The arrange of the Entity Reference been transfer into view results.

calvinjuarez’s picture

I'm having the same issue. Comment #6 recommends removing the sort criteria, but that doesn't solve OP's question of "How can I replicate the drag and drop weighting / order of entity references in my view output?"

Still no ideas there?

jmuzz’s picture

The answer from @Drupal8 worked for me. Removing all sort criteria has it sorting by its delta in its parent. Tested a few reorderings.

Charles Belov’s picture

Status: Active » Reviewed & tested by the community

I am getting the same (correct) result as jmuzz in comment #8:

Removing all sort criteria results in the view sorting by the order set in the relationship field.

minorOffense’s picture

Status: Reviewed & tested by the community » Closed (works as designed)

I don't see any code to be committed so I'm going to close this. Not sure why it's marked RTBC.