You are here

function entityform_clear_required in Entityform 7.2

Same name and namespace in other branches
  1. 7 entityform.admin.inc \entityform_clear_required()

Called via after_build on entityforms. This makes sure that required fields aren't required when saving a Draft. A Draft is not complete so it shouldn't enforce required fields.

_state

Parameters

array $form:

Return value

array

1 string reference to 'entityform_clear_required'
entityform_edit_form in ./entityform.admin.inc
Form callback: create or edit a entityform.

File

./entityform.admin.inc, line 501
Entityform editing UI.

Code

function entityform_clear_required($form, &$form_state) {
  if (!empty($form_state['triggering_element']['#entityform_draft'])) {
    _entityform_set_all_nested_props($form, array(
      '#required' => FALSE,
    ));
  }
  return $form;
}