diff --git a/views/entityreference_plugin_display.inc b/views/entityreference_plugin_display.inc index 7a1b768..1b99de7 100644 --- a/views/entityreference_plugin_display.inc +++ b/views/entityreference_plugin_display.inc @@ -76,9 +76,11 @@ class entityreference_plugin_display extends views_plugin_display { foreach ($style_options['search_fields'] as $field_alias) { if (!empty($field_alias)) { // Get the table and field names for the checked field - $field = $this->view->query->fields[$this->view->field[$field_alias]->field_alias]; + $field = $this->view->field[$field_alias]; + // Ensure the table will be joined + $this->view->query->ensure_table($field->table); // Add an OR condition for the field - $conditions->condition($field['table'] . '.' . $field['field'], $value, 'LIKE'); + $conditions->condition($field->table . '.' . $field->real_field, $value, 'LIKE'); } }