Hi,

I'm having an issue with an empty result set when I'm altering an exposed filters form on a view. What I'm attempting to do is filter a results set on two taxonomies, one of which is very large and requires use of the taxonomy_manager's tree.

I'm unsetting the default output for $form['tid_1'] and replacing it with a hierarchical tree. However when I do this I am getting an empty results set. Would I be correct in assuming that I'm upsetting the query somehow by altering the variable?

Here is what I'm doing:


function MYMODULE_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'views_exposed_form':
      unset($form['tid_1']);
      $form['tid_1'] = array(
          '#type' => 'taxonomy_manager_tree',
          '#vid' => '1',
          '#parent' => '0',
          '#multiple' => TRUE,
          '#add_term_info' => FALSE,
          '#default_value' => $form_state['input']['tid_1']
	);
      break;
    }
  return $form;
}

Can anyone point me in the correct direction?

Thanks...

Comments

jordendunne’s picture

Status: Active » Closed (fixed)

Ok, it's an issue with checkboxes versus selects. Apologies, seen a few posts about converting the selects to checkboxes now so should have a clearer understanding, although not sure it might work with the taxonomy_manager tree.

merlinofchaos’s picture

The way checkboxes are returned in Forms API makes kittens cry. I never understood the decision there.