0

I set up a view to search multiple fields of a user, and it works great when logged in as an admin, however when I am anonymous or any other user role I get this WSoD:

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

There are no access controls on the view, and any user can view a user just fine, so I'm not sure why this error is coming up.

EDIT: Here is the view

$view = new view();
$view->name = 'combined_search';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'users';
$view->human_name = 'Combined Search';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Search Businesses';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'better_exposed_filters';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Search';
$handler->display->display_options['exposed_form']['options']['bef'] = array(
  'general' => array(
    'allow_secondary' => 0,
    'secondary_label' => 'Advanced options',
  ),
  'combine' => array(
    'more_options' => array(
      'is_secondary' => 0,
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
        ),
      ),
    ),
  ),
);
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['style_options']['row_class'] = 'a-z-business-custom';
$handler->display->display_options['row_plugin'] = 'fields';
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'Sorry!  We couldn\'t find any businesses listed that matched your search criteria.  Alternatively, if you looking for a business category, you may use the business category search to the left of this page.  Once you find the business category you are looking for you can click through to see all businesses listed under said category.

If you believe that your business should show up in this search, please <a href="contact">contact</a> a site administrator.';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['max_length'] = '55';
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: User: Business Address */
$handler->display->display_options['fields']['field_business_address']['id'] = 'field_business_address';
$handler->display->display_options['fields']['field_business_address']['table'] = 'field_data_field_business_address';
$handler->display->display_options['fields']['field_business_address']['field'] = 'field_business_address';
$handler->display->display_options['fields']['field_business_address']['label'] = '';
$handler->display->display_options['fields']['field_business_address']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_business_address']['element_label_colon'] = FALSE;
/* Field: User: Business Tags */
$handler->display->display_options['fields']['field_business_tags']['id'] = 'field_business_tags';
$handler->display->display_options['fields']['field_business_tags']['table'] = 'field_data_field_business_tags';
$handler->display->display_options['fields']['field_business_tags']['field'] = 'field_business_tags';
$handler->display->display_options['fields']['field_business_tags']['label'] = '';
$handler->display->display_options['fields']['field_business_tags']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_business_tags']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_business_tags']['delta_offset'] = '0';
/* Field: User: Business Type */
$handler->display->display_options['fields']['field_bus_type']['id'] = 'field_bus_type';
$handler->display->display_options['fields']['field_bus_type']['table'] = 'field_data_field_bus_type';
$handler->display->display_options['fields']['field_bus_type']['field'] = 'field_bus_type';
$handler->display->display_options['fields']['field_bus_type']['label'] = '';
$handler->display->display_options['fields']['field_bus_type']['alter']['make_link'] = TRUE;
$handler->display->display_options['fields']['field_bus_type']['alter']['path'] = 'business-types/[field_bus_type]';
$handler->display->display_options['fields']['field_bus_type']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_bus_type']['type'] = 'taxonomy_term_reference_plain';
/* Field: User: Description */
$handler->display->display_options['fields']['field_desc']['id'] = 'field_desc';
$handler->display->display_options['fields']['field_desc']['table'] = 'field_data_field_desc';
$handler->display->display_options['fields']['field_desc']['field'] = 'field_desc';
$handler->display->display_options['fields']['field_desc']['label'] = '';
$handler->display->display_options['fields']['field_desc']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_desc']['type'] = 'text_summary_or_trimmed';
$handler->display->display_options['fields']['field_desc']['settings'] = array(
  'trim_length' => '200',
);
/* Field: User: Municipality */
$handler->display->display_options['fields']['field_municipality']['id'] = 'field_municipality';
$handler->display->display_options['fields']['field_municipality']['table'] = 'field_data_field_municipality';
$handler->display->display_options['fields']['field_municipality']['field'] = 'field_municipality';
$handler->display->display_options['fields']['field_municipality']['label'] = '';
$handler->display->display_options['fields']['field_municipality']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_municipality']['element_label_colon'] = FALSE;
/* Field: User: Business Name */
$handler->display->display_options['fields']['field_bus_name']['id'] = 'field_bus_name';
$handler->display->display_options['fields']['field_bus_name']['table'] = 'field_data_field_bus_name';
$handler->display->display_options['fields']['field_bus_name']['field'] = 'field_bus_name';
$handler->display->display_options['fields']['field_bus_name']['label'] = '';
$handler->display->display_options['fields']['field_bus_name']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_bus_name']['element_label_colon'] = FALSE;
/* Sort criterion: User: Created date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'users';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: User: Active */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'users';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: User: Roles */
$handler->display->display_options['filters']['rid']['id'] = 'rid';
$handler->display->display_options['filters']['rid']['table'] = 'users_roles';
$handler->display->display_options['filters']['rid']['field'] = 'rid';
$handler->display->display_options['filters']['rid']['value'] = array(
  4 => '4',
  7 => '7',
);
/* Filter criterion: Global: Combine fields filter */
$handler->display->display_options['filters']['combine']['id'] = 'combine';
$handler->display->display_options['filters']['combine']['table'] = 'views';
$handler->display->display_options['filters']['combine']['field'] = 'combine';
$handler->display->display_options['filters']['combine']['operator'] = 'contains';
$handler->display->display_options['filters']['combine']['exposed'] = TRUE;
$handler->display->display_options['filters']['combine']['expose']['operator_id'] = 'combine_op';
$handler->display->display_options['filters']['combine']['expose']['label'] = 'Search Businesses';
$handler->display->display_options['filters']['combine']['expose']['operator'] = 'combine_op';
$handler->display->display_options['filters']['combine']['expose']['identifier'] = 'combine';
$handler->display->display_options['filters']['combine']['expose']['remember_roles'] = array(
  2 => '2',
  1 => '1',
  3 => '3',
  4 => '4',
  5 => '5',
  6 => '6',
  7 => '7',
);
$handler->display->display_options['filters']['combine']['group_info']['label'] = 'Combine fields filter';
$handler->display->display_options['filters']['combine']['group_info']['identifier'] = 'combine';
$handler->display->display_options['filters']['combine']['group_info']['default_group'] = '1';
$handler->display->display_options['filters']['combine']['group_info']['group_items'] = array(
  1 => array(
    'title' => 'Contains',
    'operator' => 'contains',
    'value' => 'value1',
  ),
  2 => array(
    'title' => 'Contains any word',
    'operator' => 'word',
    'value' => 'value2',
  ),
);
$handler->display->display_options['filters']['combine']['fields'] = array(
  'name' => 'name',
  'field_business_address' => 'field_business_address',
  'field_business_tags' => 'field_business_tags',
  'field_bus_type' => 'field_bus_type',
  'field_desc' => 'field_desc',
  'field_bus_email' => 'field_bus_email',
  'field_municipality' => 'field_municipality',
  'field_phonenum' => 'field_phonenum',
  'field_bus_name' => 'field_bus_name',
);

/* Display: Results Page */
$handler = $view->new_display('page', 'Results Page', 'page');
$handler->display->display_options['defaults']['use_ajax'] = FALSE;
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['exposed_block'] = TRUE;
$handler->display->display_options['path'] = 'combined-search';

/* Display: Search Form */
$handler = $view->new_display('block', 'Search Form', 'block');
$handler->display->display_options['defaults']['use_ajax'] = FALSE;
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
2

The issue was with a taxonomy I had attached to the combine filter. I'm not sure why this issue happened but I found a workaround.

I created relationships to all of the (4) taxonomy fields used for user accounts, then deleted the User: [taxonomy term] from fields and added the fields for Taxonomy term: Name for each of the relationships I created.

The search now works with fuzzy search as well.

1
  • Perhaps you experienced the issue in this thread where the combined filter was still trying to reference a deleted field? drupal.org/node/2284593 – hargobind Oct 23 '14 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.