Set entity schema installation, module configuration installation and content creation in the right order in kerneltests for MongoDB

Created on 20 September 2024, about 2 months ago

Problem/Motivation

Some the kerneltests install entity schema's, install module configuration and create content. MongoDB is a bit stricter in the order of execution those actions. For MongoDB first the entity schema's need to be installed. Next the module configuration can be installed. Only then can content be created. With MongoDB entity fields are stored in the JSON document. Creating entity fields without the entity schema being installed will result in an error like:

Exception when installing config for module node, message was: Exception thrown while performing a schema update. Cannot add embedded table node_all_revisions__body to the node_all_revisions, because node_all_revisions doesn't exist.

MongoDB is also stricker in having dependent modules being installed. For instance the media entity has a dependecy on the user module. When the user module is not installed and the user entity schema installed, you get the following error:

Drupal\Core\Field\FieldException: Field 'revision_user' on entity type 'media' references a target entity type 'user' which does not exist.

Proposed resolution

Change the order of installing entity schema's, installing module configuration and content creation.

Remaining tasks

TBD

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

None

📌 Task
Status

Needs review

Version

11.0 🔥

Component
PHPUnit 

Last updated about 1 hour ago

Created by

🇳🇱Netherlands daffie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024