FieldInstance::delete() removes the instance from EntityDisplays for all view modes, but only for the 'default' form mode

Files: 
CommentFileSizeAuthor
#9 2041225-9.patch5.87 KBswentel
PASSED: [[SimpleTest]]: [MySQL] 58,963 pass(es).
[ View ]
#9 interdiff.txt690 bytesswentel
#7 2041225-7.patch5.84 KBswentel
FAILED: [[SimpleTest]]: [MySQL] 58,935 pass(es), 0 fail(s), and 1 exception(s).
[ View ]
#7 interdiff.txt1.7 KBswentel
#5 2041225-5.patch5.92 KBswentel
PASSED: [[SimpleTest]]: [MySQL] 58,247 pass(es).
[ View ]
#4 2041225-4-FAIL.patch2.43 KBswentel
FAILED: [[SimpleTest]]: [MySQL] 57,980 pass(es), 2 fail(s), and 0 exception(s).
[ View ]
#4 2041225-4-PASS.patch2.58 KBswentel
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
#4 interdiff.txt956 bytesswentel
#3 2041225-3.patch1.07 KBswentel
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

Comments

It would really helpful to have a helper to list modes per entity type

Issue tags:+Field API

tagging

Status:Active» Needs review
StatusFileSize
new1.07 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]

This should do it. Will look for tests later, because it seems the entity display tests are actually not working properly.

StatusFileSize
new956 bytes
new2.58 KB
FAILED: [[SimpleTest]]: [MySQL] Setup environment: Test cancelled by admin prior to completion.
[ View ]
new2.43 KB
FAILED: [[SimpleTest]]: [MySQL] 57,980 pass(es), 2 fail(s), and 0 exception(s).
[ View ]

Some additional tests first for entity display because they were passing without knowing. I've added an explicit check to see whether the component exists or not. Interdiff is between fail and pass.

StatusFileSize
new5.92 KB
PASSED: [[SimpleTest]]: [MySQL] 58,247 pass(es).
[ View ]

And now with form display tests too. Note that I've added a form mode alter in entity_test module so I could test multiple form modes.

Thanks, looks correct. Just nitpicks on visual review:

+++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.phpundefined
@@ -255,19 +255,32 @@ public function testDeleteFieldInstance() {
+    // Check the components exists.

Minor: plural / singular mismatch (same in the other class)

+++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityFormDisplayTest.phpundefined
@@ -119,4 +119,51 @@ public function testFieldComponent() {
+  }

Minor: missing empty line after last method.

StatusFileSize
new1.7 KB
new5.84 KB
FAILED: [[SimpleTest]]: [MySQL] 58,935 pass(es), 0 fail(s), and 1 exception(s).
[ View ]

Cleaned up.

Status:Needs review» Needs work

The last submitted patch, 2041225-7.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new690 bytes
new5.87 KB
PASSED: [[SimpleTest]]: [MySQL] 58,963 pass(es).
[ View ]

Ah, entity storage of course.

Status:Needs review» Reviewed & tested by the community

Thanks!
RTBC if green.

Status:Reviewed & tested by the community» Fixed

Committed 477cb6e and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.