You are here

function panels_node_edit_settings_form_submit in Panels 6.2

Same name and namespace in other branches
  1. 5.2 arguments/node_edit.inc \panels_node_edit_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_node_edit_settings_form_submit'
panels_node_edit_panels_arguments in arguments/node_edit.inc
@file arguments/nid.inc

File

arguments/node_edit.inc, line 95
arguments/nid.inc

Code

function panels_node_edit_settings_form_submit(&$values) {
  $types = node_get_types();
  if (!empty($values['types'])) {
    foreach ($values['types'] as $type => $value) {
      if (empty($types[$type])) {
        unset($values['types'][$type]);
      }
    }
  }
  if (!empty($values['displays'])) {
    foreach ($values['displays'] as $type => $value) {
      if (empty($types[$type])) {
        unset($values['displays'][$type]);
      }
    }
  }
}