diff --git a/core/lib/Drupal/Core/Entity/ContentEntityForm.php b/core/lib/Drupal/Core/Entity/ContentEntityForm.php index a667790..c0882a2 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityForm.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityForm.php @@ -52,7 +52,8 @@ public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); // Content entity forms only need to rebuild the entity in the validation - // and the submit handler. + // and the submit handler because Field API uses its own #after_build + // callback for its widgets. unset($form['#after_build']); $this->getFormDisplay($form_state)->buildForm($this->entity, $form, $form_state); diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php index c126fad..d5b2c7a 100644 --- a/core/lib/Drupal/Core/Entity/EntityForm.php +++ b/core/lib/Drupal/Core/Entity/EntityForm.php @@ -135,7 +135,7 @@ protected function init(FormStateInterface $form_state) { * @see \Drupal\Core\Entity\EntityForm::afterBuild() */ public function form(array $form, FormStateInterface $form_state) { - // Add process and after_build callbacks. + // Add #process and #after_build callbacks. $form['#process'][] = '::processForm'; $form['#after_build'][] = '::afterBuild'; diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index 1de0264..ac93e87 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -328,18 +328,18 @@ function testCRUDUI() { $this->assertNoFieldByName('size_value'); $id = strtolower($this->randomMachineName()); - $edit = array( + $edit = [ 'id' => $id, 'label' => $this->randomString(), 'size' => 'custom', - ); + ]; $this->drupalPostAjaxForm(NULL, $edit, 'size'); // Check that the dependent element is shown after selecting a 'size' value. $this->assertFieldByName('size'); $this->assertFieldByName('size_value'); - // Test the same scenario but it in a non-js case by using a js-hidden + // Test the same scenario but it in a non-JS case by using a 'js-hidden' // submit button. $this->drupalGet('admin/structure/config_test/add'); $this->assertFieldByName('size'); @@ -351,7 +351,7 @@ function testCRUDUI() { // Submit the form with the regular 'Save' button and check that the entity // values are correct. - $edit += array('size_value' => 'medium'); + $edit += ['size_value' => 'medium']; $this->drupalPostForm(NULL, $edit, 'Save'); $entity = entity_load('config_test', $id); diff --git a/core/modules/config/tests/config_test/src/ConfigTestForm.php b/core/modules/config/tests/config_test/src/ConfigTestForm.php index 975e27b..56195e2 100644 --- a/core/modules/config/tests/config_test/src/ConfigTestForm.php +++ b/core/modules/config/tests/config_test/src/ConfigTestForm.php @@ -119,7 +119,7 @@ public static function updateSize(array $form, FormStateInterface $form_state) { } /** - * Element submit handler for non-js testing. + * Element submit handler for non-JS testing. */ public static function changeSize(array $form, FormStateInterface $form_state) { $form_state->setRebuild();