Problem/Motivation
==================
Since CI moved to Drupal 11.4 as the current version, the following
FunctionalJavascript tests fail on the 8.x-2.x branch (and on any MR),
independently of the changes under test:
- Drupal\Tests\entity_browser\FunctionalJavascript\EntityEmbedTest (3 failures)
- Drupal\Tests\entity_browser\FunctionalJavascript\CardinalityTest::testEntityEmbed
All fail at CKEditor5TestTrait::waitForEditor() because
/node/add/test_entity_embed returns an HTTP 500:
InvalidArgumentException: Property summary is unknown.
in Drupal\Core\TypedData\Plugin\DataType\Map->get('summary')
Drupal\text\Plugin\Field\FieldType\TextWithSummaryItem->isEmpty()
Root cause
==========
Drupal core's `testing` profile now ships
core/profiles/tests/testing/config/optional/field.storage.node.body.yml
as type `text_long`. During test install this storage wins, so the
entity_browser_entity_embed_test module's own text_with_summary body
storage (config/optional) is skipped. Its field config
(field.field.node.test_entity_embed.body) stays `text_with_summary`,
producing a field/storage type mismatch → the summary property is
requested on a storage that doesn't provide it → WSOD.
Steps to reproduce
==================
Run the tests on Drupal 11.4, or a plain BrowserTestBase that installs
entity_browser_entity_embed_test and visits /node/add/test_entity_embed.
Proposed resolution
==================
Align the test body field to `text_long` (the tests do not use the
summary): update the storage, field, and form-display configs in
entity_browser_entity_embed_test.
Remaining tasks
==================
Review MR, run pipeline.
Issue fork entity_browser-3612718
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
csakiistvanComment #5
csakiistvanComment #6
csakiistvanComment #7
berdirThis needs to be tested against previous minor and major.
I'd recommend avoiding any conflicts with the "body" field by renaming the field in the test module to entity_browser_body or something like that.
Comment #8
berdirYes, as I expected, this fails on 11.3 and earlier now.
Comment #9
csakiistvanComment #10
csakiistvanComment #11
berdirSorry for the extra round, but does anything actually use the body field? I don't see any test updates being necessary, which they would if we'd actually set any values to that field.
We had cases like this in core before, essentially those node types might have been created manually in the UI and exported and the body field came with that. But if it's not relevant to any test, we could also just completely remove that?
Comment #12
csakiistvanThanks for the review. The body field can't be removed entirely: it's the formatted-text field the CKEditor5 instance attaches to, and the entity embed button (
pressEditorButton()) is rendered on it. Without it there would be no editor on the node form andwaitForEditor()would fail.No test sets a value on the field, and the tests never reference it by name — that's exactly why the rename to
entity_browser_bodyneeds no test changes while still resolving the collision with core'snode.body (text_long)from the testing profile.Comment #14
berdirOk, thanks for checking. Merged!