- Issue created by @Dave Kopecek
The ERD module does not properly clean up its state data during uninstallation. The module stores diagram state in the State API under 'erd.graph', but this data persists in the database after module uninstallation since there was no uninstall hook to remove it.
1. Install the ERD module
2. Create and save an entity relationship diagram
3. Uninstall the module
4. Check the key_value table in the database - the 'erd.graph' state data remains
Add an erd.install file with hook_uninstall() to properly clean up the module's state data:
<?php
/**
* @file
* Install, update and uninstall functions for the ERD module.
*/
/**
* Implements hook_uninstall().
*/
function erd_uninstall() {
\Drupal::state()->delete('erd.graph');
}
1. Review and test the proposed fix
2. Commit the new erd.install file
None
None
The fix ensures proper cleanup of state data during module uninstallation. No changes to the data model itself.
Active
2.0
Code