function smart_date_recur_form_field_storage_config_edit_form_alter in Smart Date 3.0.x
Same name and namespace in other branches
- 8.2 modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
- 3.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
- 3.1.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
- 3.2.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
- 3.3.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
- 3.4.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_form_field_storage_config_edit_form_alter()
Add configuration elements for Smart Date field storage.
File
- modules/
smart_date_recur/ smart_date_recur.module, line 397 - Field hooks for a field that stores a start and end date as timestamps.
Code
function smart_date_recur_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) {
// Only try to add our option to Smart Date fields.
$field = $form_state
->getFormObject()
->getEntity();
if ($field
->getType() != 'smartdate') {
return;
}
$messenger = \Drupal::messenger();
$messenger
->addMessage(t('Recurring values can only be used on Smart Date fields that allow unlimited values.'), 'warning');
}