This module helps resolve inconsistencies between Drupal's configuration and its database that can cause errors and unexpected behavior. It provides a report and a tool to fix these "mismatched entity and/or field definitions" errors, which can occur after updates or configuration changes.
Mismatched entity and/or field definitions (meaofd) module has as its main purpose to solve a common problem in Drupal website development that appears under the same title on the Status report (/admin/reports/status) page on the website itself.
What is the Mismatched entity and/or field definitions error?
The Mismatched entity and/or field definitions error occurs when there is a discrepancy between the expected structure of entities or fields in Drupal's configuration and the actual state of the database. This typically happens after changes to entity or field definitions, either during module updates, schema changes, or configuration imports between different environments. These inconsistencies can cause unexpected behavior, such as broken field displays, issues with saving or editing entities, and even prevent entities from being properly rendered.
How is it used the Mismatched entity and/or field definitions module?
The module provides a report page through the menu Reports > Mismatched entity and/or field definitions or directly at /admin/reports/mismatched-entity-and-or-field-definitions. The report groups detected changes by entity type and lists the affected field or definition, whether it needs to be installed, updated, or uninstalled, and the available action. Field entries also show their field type and provider when available.
Expand an entry in the Details column to inspect the definition information. For updates, the report compares the installed and current values of the properties Drupal inspects, such as entity tables and keys or field storage settings and schema. For installations and removals, it displays the definition that will be added or removed. If Drupal reports a mismatch but no difference is found in the inspected properties, the report says so explicitly.
Use Fix or Fix all (n), where n is the number of detected changes for the affected entity type, then confirm the operation and wait for the batch process to finish. The action fixes those changes together.
The module also provides the Drush command meaofd:fix <entity_type_id> to correct the error on the machine, for example, if the entity affected by this error is “Paragraph”, the command to execute to correct the entity is drush meaofd:fix paragraph. It is also possible to call the fix method of the meaofd.fixer service by passing it the ID of the entity type as a parameter. For example:
\Drupal::service("meaofd.fixer")->fix("node");
This is very useful to fix this error between environments automatically with a hook_update_N() function.
Installation
Install as you would normally install a contributed Drupal module. For further
information, see Installing Drupal Modules.
Supporting this Module
Please report bugs to the Drupal.org issue queue.
Note that the maintainers are not actively supporting development of new
features. However, contributions to add features are welcome provided they are
narrow in scope, well written, and well documented.
Ask your assistant about Mismatched entity and/or field definitions
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha4 | Pre-release | 9–11 | Dec 26, 2024 | ||
| 1.0.0-alpha3 | Pre-release | 8–11 | Dec 26, 2024 | ||
| 1.0.0-alpha2 | Pre-release | 8–11 | Dec 24, 2024 | ||
| 1.0.0-alpha1 | Pre-release | 9–11 | Oct 16, 2024 |