public function SearchApiViewsHandlerFilterOptions::value_submit in Search API 7
Save set checkboxes.
Overrides views_handler_filter::value_submit
File
- contrib/
search_api_views/ includes/ handler_filter_options.inc, line 144 - Contains the SearchApiViewsHandlerFilterOptions class.
Class
- SearchApiViewsHandlerFilterOptions
- Views filter handler for fields with a limited set of possible values.
Code
public function value_submit($form, &$form_state) {
// Drupal's FAPI system automatically puts '0' in for any checkbox that
// was not set, and the key to the checkbox if it is set.
// Unfortunately, this means that if the key to that checkbox is 0,
// we are unable to tell if that checkbox was set or not.
// Luckily, the '#value' on the checkboxes form actually contains
// *only* a list of checkboxes that were set, and we can use that
// instead.
$form_state['values']['options']['value'] = $form['value']['#value'];
}