Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.7
Component:
exposed filters
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2009 at 12:41 UTC
Updated:
16 Dec 2009 at 20:30 UTC
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
Comment #1
jordendunne commentedOk, 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.
Comment #2
merlinofchaos commentedThe way checkboxes are returned in Forms API makes kittens cry. I never understood the decision there.