Broken entity reference finder
Find the existing broken entity references to improve quality.
Ever had a situation where removing entity suddenly prevents unexpected pages to load?
Maybe your site now throws error like this
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getCacheTags() on null in Drupal\views\Plugin\views\query\Sql->getCacheTags() (line 1677 of core/modules/views/src/Plugin/views/query/Sql.php).
Many cases, this is result of some other entity referencing to the entity that just got deleted.
This module offers you quick way to check whether you have such broken references laying around.
Note: This module does not fix those entities, but allows you to research if you are in need of some hook_ENTITY_delete or hook_ENTITY_TYPE_delete implementations (or the existing ones need some more attention). Also note that this module reveals only the broken references that already exists, not the ones that are yet to come.
For each entity type there should be implementation of such hook, which either removes the referencing entity or cleans up the references. Note that even if you are certain that the entity (of some type) never gets deleted, be prepared for that one case where it needs to be.
How to use:
- Install this module
- Head to Reports -> Broken entity references (or just
admin/config/development/broken_reference) - You'll see quick report here already
- Press the "Build report" to get full listing
- Tell your employer that each represented line might cause sudden page crash at some point
In the report target entities are the entities that does not appear in the system anymore, source entities are the ones that still has reference to those target entities. If numbers does not match, it means that one source entity is referencing to multiple removed target entities in the same field.
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.