Default content exports are invalid and hence are not correct after importing

Created on 27 May 2025, 6 days ago

Overview

Discovered by @justafish!

πŸ› Core's default content importer fumbles Experience Builder field data Active introduced DefaultContentImportTest. It introduced tests/fixtures/xb-page-with-data.yml, and is used by (and tested by \Drupal\Tests\experience_builder\Functional\DefaultContentImportTest::testImportDefaultContentWithXbData()).

Then πŸ“Œ [PP-1] Consider not storing the ComponentTreeStructure data type as a JSON blob Postponed happened! It updated the fixture. Tests are passing.

However, as @justafish was working on improving our end-to-end test infrastructure, she exported sample content entities to JSON using the default_content contrib module And the result of that export … is sadly broken, because for the component instances at the root level it generated:

parent_uuid: ''
slot: ''

whereas those should've been either NULL or omitted.

Put differently: exporting imported default content does not result in the same fixture πŸ™ˆ

Worse: the Recipes default content import functionality apparently did not report a validation error?! 😱

Proposed resolution

  1. Expand \Drupal\Tests\experience_builder\Functional\DefaultContentImportTest to export its imported data, and verify it matches the fixture
  2. Figure out why there's no validation happening when importing default content.

User interface changes

None.

πŸ“Œ Task
Status

Active

Version

0.0

Component

Data model

Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024