Commit 02ad0e31 authored by Nesta Campbell's avatar Nesta Campbell
Browse files

Fixed empty category select list bug.

parent 55890c87
......@@ -108,34 +108,34 @@ function search_config_form_alter($form_id, &$form) {
}
}
// Taxonomy
if (variable_get('search_config_disable_category_all', 0) || !user_access('search by category')) {
unset($form['advanced']['category']);
}
else {
$terms = variable_get('search_config_disable_category', array());
$taxonomy = module_invoke('taxonomy', 'form_all', 1);
// FIXME: What about multiple hierarchy categories?
foreach ($taxonomy as $vocab => $term) {
foreach ($term as $k => $v) {
if(in_array($k, $terms)) {
unset($taxonomy[$vocab][$k]);
if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
// Taxonomy
if (variable_get('search_config_disable_category_all', 0) || !user_access('search by category')) {
unset($form['advanced']['category']);
}
else {
$terms = variable_get('search_config_disable_category', array());
// FIXME: What about multiple hierarchy categories?
foreach ($taxonomy as $vocab => $term) {
foreach ($term as $k => $v) {
if(in_array($k, $terms)) {
unset($taxonomy[$vocab][$k]);
}
}
}
}
// Taxonomy box:
$form['advanced']['category'] = array(
'#type' => 'select',
'#title' => t('Only in the category(s)'),
'#prefix' => '<div class="criterion">',
'#size' => 10,
'#suffix' => '</div>',
'#options' => $taxonomy,
'#multiple' => TRUE,
);
// Taxonomy box:
$form['advanced']['category'] = array(
'#type' => 'select',
'#title' => t('Only in the category(s)'),
'#prefix' => '<div class="criterion">',
'#size' => 10,
'#suffix' => '</div>',
'#options' => $taxonomy,
'#multiple' => TRUE,
);
}
}
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment