Reproduce:

  1. Add 2 searchable fields
  2. Add a Combine fields filter with those 2 fields
  3. Remove one of the fields
  4. Save view and search with the combined filter

Expected result:

  • One of the fields in the Combine fields filter config is ignored, since it doesn't exist anymore. OR
  • You can't save the view, because it contains invalid config. OR
  • When all the combined filter fields are missing: the filter doesn't do anything

Result instead:

Fatal error: Call to a member function ensure_my_table() on a non-object in views/handlers/views_handler_filter_combine.inc on line 60

I don't know which of the expected results is the right one, so I won't make a patch with one.

Comments

rudiedirkx’s picture

Issue summary: View changes
puddyglum’s picture

I also get this when I simply exclude a field from being displayed. My goal is to be able to search by the value of a field, but not display it in the results.

puddyglum’s picture

A similar issue was resolved by https://www.drupal.org/node/2284593

Can you apply that patch and see?

puddyglum’s picture

rudiedirkx’s picture

Status: Active » Fixed

Yup, that's it. Why did this issue not get any love in forever? =(

puddyglum’s picture

The only issue I have with this patch is that it simply protects itself from a fatal error rather than preventing empty field objects.

I want to exclude a field from display, but include it in the Combine fields filter.

The patch keeps the above from throwing a fatal error, but the field is still not searched by the combine fields filter.

Is this Works as designed?

The user has control over whether or not to include a field in the Combine Fields filter, so it seems like they should be able to search on it. Would it make sense to code a way for that to happen?

puddyglum’s picture

Status: Fixed » Needs review
rudiedirkx’s picture

No, that doesn't work properly IMO, but that wasn't my issue. A hidden field should be searchable. It's VERY strange if it isn't. I haven't reproduced. You?

Maybe we should have this discussion in the other issue, since people actually watch that and it's relevant.

puddyglum’s picture

Status: Needs review » Closed (duplicate)