Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the sort criteria of the view output is:
"Field collection item: Field collection item ID (asc)"
This differs from the order set in the node edit form.
It would be good if the output conforms to the order set in the node edit form.
Great project BTW.
Comments
Comment #1
bennybobw CreditAttribution: bennybobw commentedThis is what I did in my hook_views_pre_render to fix this:
Comment #2
rosberg CreditAttribution: rosberg commentedI have been struggling with this issue myself.
Thank you very much bennybobw for a working solution!
Comment #3
daniel-san CreditAttribution: daniel-san commentedJust wanted to let you know that this worked for me as well. Thank you for the solution.
Comment #4
neerajskydiver CreditAttribution: neerajskydiver commentedThe solution works well with the ordering. However I tried making a generic solution for the problem by fetching the delta of the items in the field collection but that did not work out as the weight is not saved in the database.
Unless field collection module itself saves some kind of information about the weight this is the best solution to sort out the issue.
Cheers
Comment #5
dieppon CreditAttribution: dieppon as a volunteer commentedHi,
hook_views_pre_render did not work for me but MY_MODULE_views_post_execute did.
Kind regards