function views_plugin_style::options_validate

Overrides views_plugin::options_validate

File

plugins/views_plugin_style.inc, line 300

Class

views_plugin_style
Base class to define a style plugin handler.

Code

public function options_validate(&$form, &$form_state) {
    // Don't run validation on style plugins without the grouping setting.
    if (isset($form_state['values']['style_options']['grouping'])) {
        // Don't save grouping if no field is specified.
        foreach ($form_state['values']['style_options']['grouping'] as $index => $grouping) {
            if (empty($grouping['field'])) {
                unset($form_state['values']['style_options']['grouping'][$index]);
            }
        }
    }
}