- 🇺🇸United States Eric At NRD
I could not get #7 to work right for my use case. However, an alternate method using hook_views_post_execute() DID work for me:
https://www.drupal.org/project/field_collection_views/issues/2075593#com... →I post this here only in case others ran into circumstances where #7 did not work.
- 🇮🇷Iran mr.hadimollaei
Hello
After searching and checking the experiences of others, unfortunately, I did not reach my desired result
So I created this command that returns the delta value:function get_field_collection_delta($item_id,$table,$field){
$query = "SELECT delta FROM $table WHERE $field = $item_id";
$delta = db_query($query)->fetchCol();
return $delta;
}Then I created a sort using PHP Views module and wrote the following in it:
$delta1 = get_field_collection_delta($row1->item_id,'field_data_field_art_files_collection','field_art_files_collection_value');
$delta2 = get_field_collection_delta($row2->item_id,'field_data_field_art_files_collection','field_art_files_collection_value');
return $delta1 > $delta2;