public function WebformUiOptionsForm::afterBuild in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_ui/src/WebformUiOptionsForm.php \Drupal\webform_ui\WebformUiOptionsForm::afterBuild()
Form element #after_build callback: Updates the entity with submitted data.
Updates the internal $this->entity object with submitted values when the form is being rebuilt (e.g. submitted via AJAX), so that subsequent processing (e.g. AJAX callbacks) can rely on it.
Overrides EntityForm::afterBuild
File
- modules/
webform_ui/ src/ WebformUiOptionsForm.php, line 35
Class
- WebformUiOptionsForm
- Base for controller for webform option UI.
Namespace
Drupal\webform_uiCode
public function afterBuild(array $element, FormStateInterface $form_state) {
// Overriding after \Drupal\Core\Entity\EntityForm::afterBuild because
// it calls ::buildEntity(), which calls ::copyFormValuesToEntity, which
// attempts to populate the entity even though the 'options' have not been
// validated and set.
// @see \Drupal\Core\Entity\EntityForm::afterBuild
// @eee \Drupal\webform_ui\WebformUiOptionsForm::copyFormValuesToEntity
// @see \Drupal\webform\Element\WebformOptions
return $element;
}