Community

Views custom filter does not work in production site

Hi all,

I have a very wird problem. I have developed custom views filter that I have attached to my custom module. In my developer site, when I make a view and I apply my custom filter, which is really quite simple (see below), everything works fine. But when I migrated all site to testserver / production server, I get information like

Broken/missing handler for views filter

and I completley do not know why?
- modules are the same
- settings for modules I think are the same
- code is the same
But I get information that I cannot use my filter, which is really important for views I would like to use. Is there a place where I can get detailed error description, f.i. why handler is not seen?
Or maybe there are some special settings that I miss? But why it works on developement site?

What is more confusing, when I switch implementation of table mapping like in code below

  $data['arts_stellen']['ref_ansprechpartner_nid'] = array(
      'title'  => t('ref_ansprechpartner_nid'),
      'help'   => t('ARTS-Stellen-ansprechpartner_nid'),
      'field'  => array('handler' => 'views_handler_field_numeric','click sortable' => TRUE,),

// remove custom filter
      //'filter' => array('handler' => 'views_handler_filter_ansprechpartner',),
// use one of default Drupal filters
      'filter'   => array('handler' => 'views_handler_filter_string',),
      'sort'   => array('handler' => 'views_handler_sort',),
  );

then I get access to this field and I can filter it. Could someone please gieve me a hint where I possibly made an error?

Best Regards
Piotr

class views_handler_filter_ansprechpartner extends views_handler_filter_in_operator {
  function value_form(&$form, &$form_state) {
$ap_select_box = array();
$ap_select_box[0] = '';
$result_ansprechpartner = db_query('SELECT nid, title FROM {node} WHERE type = "ansprechpartner" ORDER BY title');
while ($ap = db_fetch_array($result_ansprechpartner)) {
$ap_select_box[$ap['nid']] = $ap['title'];
}

    $form['value'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#size' => '9',
    '#title' => t('State'),
     '#options' => $ap_select_box,
    );

    return $form;
  }
}

Comments

This behavior happens when

This behavior happens when either the file does not exist or the module is not enabled on the target environment. Or, perhaps more simply, have you cleared your cache on the production site?

Thanks for Your answer, sorry

Thanks for Your answer, sorry I have not respond earlier.

"This behavior happens when either the file does not exist"

And in fact that was the reason. I have two modules that uses those filters but I did not know that in both modules those filters have to be defined. To make it more clear, in my dev env that was working accidentally, hard to say why.
Anyway, module A and B wanted to use filters from module A and that was the problem.

BR
Piotr