You are here

function ffc_validate_field_display_overview in Field formatter conditions 7

Validate handler to clean up empty formatter conditions.

1 string reference to 'ffc_validate_field_display_overview'
ffc_form_field_ui_display_overview_form_alter in ./ffc.module
Implements hook_form_field_ui_display_overview_form_alter().

File

./ffc.module, line 28
Field formatter conditions.

Code

function ffc_validate_field_display_overview(&$form, &$form_state) {
  if (!empty($form_state['formatter_settings']) && is_array($form_state['formatter_settings'])) {
    foreach ($form_state['formatter_settings'] as $key => $info) {
      if (empty($info['conditions'][0]['condition'])) {
        $form_state['formatter_settings'][$key]['conditions'] = array();
      }
    }
  }
}