You are here

function panels_term_settings_form_submit in Panels 5.2

Same name and namespace in other branches
  1. 6.2 arguments/term.inc \panels_term_settings_form_submit()

There appears to be a bit of a bug with the way we're handling forms; it causes 'checkboxes' to get invalid values added to them when empty. This takes care of that.

1 string reference to 'panels_term_settings_form_submit'
panels_term_panels_arguments in arguments/term.inc
@file arguments/term.inc

File

arguments/term.inc, line 131
arguments/term.inc

Code

function panels_term_settings_form_submit(&$values) {
  $vocs = taxonomy_get_vocabularies();
  if (!empty($values['vids'])) {
    foreach ($values['vids'] as $vid => $value) {
      if (empty($vocs[$vid])) {
        unset($values['vids'][$vid]);
      }
    }
  }
  if (!empty($values['displays'])) {
    foreach ($values['displays'] as $vid => $value) {
      if (empty($vocs[$vid])) {
        unset($values['displays'][$vid]);
      }
    }
  }
}