function label_length_limit_form_field_ui_field_storage_add_form_alter in Override label length limititation 8
Same name and namespace in other branches
- 2.0.x label_length_limit.module \label_length_limit_form_field_ui_field_storage_add_form_alter()
Implements hook_form_FORM_ID_alter().
File
- ./
label_length_limit.module, line 42 - Contains label_length_limit.module.
Code
function label_length_limit_form_field_ui_field_storage_add_form_alter(&$form, &$form_state, $form_id) {
if (isset($form['new_storage_wrapper']['label'])) {
$config = \Drupal::config('label_length_limit.labellengthlimit');
$label_max_length = $config
->get('label_max_length');
$form['new_storage_wrapper']['label']['#maxlength'] = $label_max_length;
}
if (isset($form['existing_storage_label'])) {
$form['existing_storage_label']['#maxlength'] = $label_max_length;
}
}