Loading core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -437,7 +437,7 @@ public function testCommentFunctionality() { // Add a new comment field. $storage_edit = [ 'field_storage[subform][settings][comment_type]' => 'foobar', 'settings[comment_type]' => 'foobar', ]; $this->fieldUIAddNewField('entity_test/structure/entity_test', 'foobar', 'Foobar', 'comment', $storage_edit); Loading core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -381,7 +381,7 @@ protected function createEntityReferenceField($target_type, $bundles = []) { $field_name = $this->randomMachineName(); $storage_edit = $field_edit = []; $storage_edit['field_storage[subform][settings][target_type]'] = $target_type; $storage_edit['settings[target_type]'] = $target_type; foreach ($bundles as $bundle) { $field_edit['settings[handler_settings][target_bundles][' . $bundle . ']'] = TRUE; } Loading core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php +16 −1 Original line number Diff line number Diff line Loading @@ -84,8 +84,23 @@ public function fieldUIAddNewField($bundle_path, $field_name, $label = NULL, $fi // Test Breadcrumbs. $this->getSession()->getPage()->findLink($label); // Ensure that each array key in $storage_edit is prefixed with field_storage. $prefixed_storage_edit = []; foreach ($storage_edit as $key => $value) { if (str_starts_with($key, 'field_storage')) { $prefixed_storage_edit[$key] = $value; continue; } // If the key starts with settings, it needs to be prefixed differently. if (str_starts_with($key, 'settings[')) { $prefixed_storage_edit[str_replace('settings[', 'field_storage[subform][settings][', $key)] = $value; continue; } $prefixed_storage_edit['field_storage[subform][' . $key . ']'] = $value; } // Second step: 'Storage settings' form. $this->submitForm($storage_edit, 'Update settings'); $this->submitForm($prefixed_storage_edit, 'Update settings'); // Third step: 'Field settings' form. $this->submitForm($field_edit, 'Save settings'); Loading core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ public function testPrivateFileComment() { $name = $this->randomMachineName(); $label = $this->randomMachineName(); $storage_edit = ['field_storage[subform][settings][uri_scheme]' => 'private']; $storage_edit = ['settings[uri_scheme]' => 'private']; $this->fieldUIAddNewField('admin/structure/comment/manage/comment', $name, $label, 'file', $storage_edit); // Manually clear cache on the tester side. Loading core/modules/link/tests/src/Functional/LinkFieldUITest.php +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public function runFieldUIItem($cardinality, $link_type, $title, $label, $field_ $field_edit['default_value_input[field_' . $field_name . '][0][title]'] = 'Default title'; } $storage_edit = [ 'field_storage[subform][cardinality_number]' => $cardinality, 'cardinality_number' => $cardinality, ]; $this->fieldUIAddNewField($type_path, $field_name, $label, 'link', $storage_edit, $field_edit); Loading Loading
core/modules/comment/tests/src/Functional/CommentNonNodeTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -437,7 +437,7 @@ public function testCommentFunctionality() { // Add a new comment field. $storage_edit = [ 'field_storage[subform][settings][comment_type]' => 'foobar', 'settings[comment_type]' => 'foobar', ]; $this->fieldUIAddNewField('entity_test/structure/entity_test', 'foobar', 'Foobar', 'comment', $storage_edit); Loading
core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -381,7 +381,7 @@ protected function createEntityReferenceField($target_type, $bundles = []) { $field_name = $this->randomMachineName(); $storage_edit = $field_edit = []; $storage_edit['field_storage[subform][settings][target_type]'] = $target_type; $storage_edit['settings[target_type]'] = $target_type; foreach ($bundles as $bundle) { $field_edit['settings[handler_settings][target_bundles][' . $bundle . ']'] = TRUE; } Loading
core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php +16 −1 Original line number Diff line number Diff line Loading @@ -84,8 +84,23 @@ public function fieldUIAddNewField($bundle_path, $field_name, $label = NULL, $fi // Test Breadcrumbs. $this->getSession()->getPage()->findLink($label); // Ensure that each array key in $storage_edit is prefixed with field_storage. $prefixed_storage_edit = []; foreach ($storage_edit as $key => $value) { if (str_starts_with($key, 'field_storage')) { $prefixed_storage_edit[$key] = $value; continue; } // If the key starts with settings, it needs to be prefixed differently. if (str_starts_with($key, 'settings[')) { $prefixed_storage_edit[str_replace('settings[', 'field_storage[subform][settings][', $key)] = $value; continue; } $prefixed_storage_edit['field_storage[subform][' . $key . ']'] = $value; } // Second step: 'Storage settings' form. $this->submitForm($storage_edit, 'Update settings'); $this->submitForm($prefixed_storage_edit, 'Update settings'); // Third step: 'Field settings' form. $this->submitForm($field_edit, 'Save settings'); Loading
core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ public function testPrivateFileComment() { $name = $this->randomMachineName(); $label = $this->randomMachineName(); $storage_edit = ['field_storage[subform][settings][uri_scheme]' => 'private']; $storage_edit = ['settings[uri_scheme]' => 'private']; $this->fieldUIAddNewField('admin/structure/comment/manage/comment', $name, $label, 'file', $storage_edit); // Manually clear cache on the tester side. Loading
core/modules/link/tests/src/Functional/LinkFieldUITest.php +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public function runFieldUIItem($cardinality, $link_type, $title, $label, $field_ $field_edit['default_value_input[field_' . $field_name . '][0][title]'] = 'Default title'; } $storage_edit = [ 'field_storage[subform][cardinality_number]' => $cardinality, 'cardinality_number' => $cardinality, ]; $this->fieldUIAddNewField($type_path, $field_name, $label, 'link', $storage_edit, $field_edit); Loading