Dear all,

if you are looking for an option to filter for "all of" through entity reference - you can do this as per this change in entityreference_filter/views/entityreference_filter_view_result.inc

-class entityreference_filter_view_result extends views_handler_filter_in_operator {
+class entityreference_filter_view_result extends views_handler_filter_many_to_one {

This might not be persistent, but experimental as discussed here:

The reason I am using this for my productive sites is simple: I have a list of items that I would like to filter by multiple referenced entities. What I needed was the result to shown only nodes that include all references. As of now it was only possible to filter by single references.

CommentFileSizeAuthor
entityreference_filter.component.patch513 bytesnhck

Comments

maximpodorov’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

I think "is all of" operator is inappropriate for this module goals. Please reopen the issue if you can provide more details of your idea.

nhck’s picture

Issue summary: View changes
Status: Closed (works as designed) » Active

I have added a sample use case accordingly. Hope it helps. Imho a lot of usage explanation is already included in #1494884: Why is there no "is all of" operator for select list filters?

maximpodorov’s picture

Is your patch appropriate for any situations this module was created for?

nhck’s picture

Lets say you have a content type car and a content type repair shop. Obviously only certain repair shops can take care of certain cars.
Also your third content type for the reference car parts relates to the type of car as well, because your car only takes certain parts.

Now you are looking for multiple repair parts for your car. Imho you would filter the list of repair shops by the car parts which go with the car.

Would you rather be shown a shop which has one of the parts, none of the parts or one that has all of the parts?

This module allows to pull in a view to provide filter options. In practice these filter options are exposed as checkboxes. As of the current configuration, If you check multiple of those checkboxes, you can only be shown results which are related to one of or to none of the chosen boxes. It is not possible to have the shown results satisfy all of the checked boxes.

The answer to your question hence is No: it is an upstream feature extension of the original set thus this feature request. Downstream modules like this can easily implement it. When you build this module - it was built on top an existing class structure. This class structure offers more features now and this one is specifically useful. It would be a waste if downstream modules like this wouldn't implement it.
But of course, I'd understand if you like to postpone this, even for the dev version, until the referenced issues are resolved.

nhck’s picture

nithinkolekar’s picture

after four years this issue last updated nor views or any other other module implemented this feature which is very useful to get entities having same nids among them.
ex:
list of products purchased same as user X (current user for ex)
list of movies with common 3 actors
list of user studied in same city and school (both entity ref fields)

From the beginning views has built in(hardcoded) contextual filter like "Content: Has taxonomy term ID" with configuration
"Taxonomy term id from url" >> "Load default filter from node page, that's" >> "Filter to items that share all terms"
but not extended to support EntityReference fields.