You are here

function date_repeat_field_set_cardinality in Date 8

Same name and namespace in other branches
  1. 7.3 date_repeat_field/date_repeat_field.module \date_repeat_field_set_cardinality()
  2. 7.2 date_repeat_field/date_repeat_field.module \date_repeat_field_set_cardinality()

Ensure the cardinality gets updated if the option to make a date repeating is checked.

1 string reference to 'date_repeat_field_set_cardinality'
date_repeat_field_form_field_ui_field_edit_form_alter in date_repeat_field/date_repeat_field.module
Implements hook_form_FORM_ID_alter() for field_ui_field_edit_form().

File

date_repeat_field/date_repeat_field.module, line 633
Creates the option of Repeating date fields and manages Date fields that use the Date Repeat API.

Code

function date_repeat_field_set_cardinality($element, &$form_state) {
  if (!empty($form_state['values']['field']['settings']['repeat'])) {
    form_set_value($element['cardinality'], FIELD_CARDINALITY_UNLIMITED, $form_state);
  }
}