Commit a21dd243 authored by Nesta Campbell's avatar Nesta Campbell
Browse files

Fixes #122167. Thanks NaX.

parent 02ad0e31
......@@ -123,18 +123,27 @@ function search_config_form_alter($form_id, &$form) {
unset($taxonomy[$vocab][$k]);
}
}
// Remove empty vocabs
if (count($taxonomy[$vocab]) == 0) {
unset($taxonomy[$vocab]);
}
}
// 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,
);
if (count($taxonomy) == 0) {
unset($form['advanced']['category']);
}
else {
// 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,
);
}
}
}
}
......
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