I have field_collection_item view, where I am passing multiple arguments using contextual filter. It is giving me result sorted by item_id, i haven't added any sort criteria but I wanted result as per db records order. I am trying to add orderby field values in view_query_alter as below:

$view->query->add_orderby("Field(field_collection_item.item_id,2204,2198,2201,2195)");

It is not working.

Comments

reshma.i created an issue. See original summary.

reshma.i’s picture

Project: Field collection view mode » Field Collection Views
Version: » 7.x-1.x-dev
astonvictor’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.