Account created on 3 June 2011, over 13 years ago
#

Recent comments

🇮🇷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;

Production build 0.71.5 2024