protected FieldStorageAddForm::validateAddExisting(array $form, FormStateInterface $form_state)
Validates the 're-use existing field' case.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
See also
\Drupal\field_ui\Form\FieldStorageAddForm::validateForm()
File
- core/modules/field_ui/src/Form/FieldStorageAddForm.php, line 290
Class
- FieldStorageAddForm
- Provides a form for the "field storage" add page.
Namespace
Drupal\field_ui\Form
Code
1 2 3 4 5 6 7 8 | protected function validateAddExisting( array $form , FormStateInterface $form_state ) { if ( $form_state ->getValue( 'existing_storage_name' )) { // Missing label. if (! $form_state ->getValue( 'existing_storage_label' )) { $form_state ->setErrorByName( 'existing_storage_label' , $this ->t( 'Re-use existing field: you need to provide a label.' )); } } } |
Please login to continue.