Problem/Motivation
When rabbit_hole module and storage module are in use on the same site there is an issue in the order they are installed.
If storage in installed first, then you will receive this error message on the status report page after rabbit hole is installed:
Entity/field definitions
Mismatched entity and/or field definitions
The following changes were detected in the entity type and field definitions.
Storage
The Rabbit Hole action field needs to be installed.
The Rabbit Hole redirect path. field needs to be installed.
The Rabbit Hole redirect response code field needs to be installed.
The Rabbit Hole redirect fallback action field needs to be installed.
Steps to reproduce
On a clean Drupal install in this order as 2 steps:
- Enable storage module
- Enable rabbit hole module
What is happening is:
Storage module implements hook_entity_base_field_info
which provides the Rabbit Hole plugins. At the time of install, this service does not exist so nothing is added here.
When rabbit hole module is installed the field then becomes provided by storage_entity_base_field_info.
When the ModuleInstaller enables a module, it looks through the provided field storage definitions and updates the lasted installed repository if the field is provided by the module being installed.
In this case - rabbit hole is the module being installed, but storage is the provider of the field definiton, so at https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/lib/Drupal/... the field is skipped and never makes it into the last installed repository.
Proposed resolution
Provide the integration as a submodule that depends on both storage and rabbit_hole to ensure the correct dependencies exist (as was proposed in initial issue for integration
https://www.drupal.org/project/storage/issues/3220934 →
)
Remaining tasks
- Move to submodule
- Update hook to enable submodule if both storage and rabbit_hole are currently enabled
User interface changes
Required additional module to be installed for integration
API changes
Integration moved to sub module.
Data model changes
N/A