Closed (fixed)
Project:
Entity reference
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2012 at 19:58 UTC
Updated:
21 Sep 2012 at 22:21 UTC
I went through all the steps of making the Views filter for my entity reference field a select list by editing the field configuration and enabling the "Enable Render Views filters as select list" but I go to a view and add a filter for my field (which has only about 15 possible values), the View does not work because it returns the error "The operator is invalid on filter: Content My field name".
Comments
Comment #1
dave reidIf I save the View anyway and go to my View page, I get the following:
Notice: Undefined index: field_office_target_id in views_handler_filter->accept_exposed_input() (line 1260 of sites/all/modules/views/handlers/views_handler_filter.inc).Comment #2
haydeniv commentedYou need to reset the filter operator in the view filter if you created the view before checking "Enable Render Views filters as select list" on the field options.
The reason being the comparison operators have a different key due to different options being available. Drove me nuts the first time I ran into this while that feature was being developed.
Comment #3
dave reidYeah so the problem was even though I had fixed the current View display I was working on, the preview was still showing me errors about filters on every other display. So once I went through and fixed all the other display filters to use the 'Is in' operator for my entity reference field, the view could save and it worked as expected.