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.

Command icon 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

csakiistvan created an issue. See original summary.

csakiistvan’s picture

Title: https://www.drupal.org/project/entity_browser/issues/2946829#comment-16702887 » Fix failing CKEditor/entity_embed tests on Drupal 11.4 (body field type mismatch with testing profile)

csakiistvan changed the visibility of the branch 3612718-httpswww.drupal.orgprojectentitybrowserissues2946829comment-16702887 to hidden.

csakiistvan’s picture

Status: Active » Needs review
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
berdir’s picture

This 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.

berdir’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Yes, as I expected, this fails on 11.3 and earlier now.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs work » Needs review
berdir’s picture

Sorry 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?

csakiistvan’s picture

Thanks 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 and waitForEditor() 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_body needs no test changes while still resolving the collision with core's node.body (text_long) from the testing profile.

  • berdir committed 6c23876b on 8.x-2.x authored by csakiistvan
    test: #3612718 Fix failing CKEditor/entity_embed tests on Drupal 11.4 (...
berdir’s picture

Status: Needs review » Fixed

Ok, thanks for checking. Merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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