With hook_modules_uninstalled, we can automatically remove blocks provided by uninstalled modules. Patch following shortly.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | hook_modules_uninstalled_block.patch | 801 bytes | mr.baileys |
| #1 | 335240-modules-uninstalled-block-D7.patch | 805 bytes | dave reid |
Comments
Comment #1
dave reidPatch is in.
Comment #3
dave reidHmm... interesting failure...
Comment #4
dave reidComment #5
dropcube commentedActually, blocks provided by uninstalled modules are removed the next time
_block_rehashruns.If we have hook_block as a registry style hooks, that can be done automatically during the hooks rebuild (or system clean-up) triggered when a module is activated/deactivated/uninstalled.
Comment #6
mr.baileys#357321: Rename hook_permission() into hook_permission_info() for consistency has been pushed back to D8...
Attached is an updated patch that also clears
block_role._block_rehashcould be an alternative, but it doesn't seem to clear theblock_roleandblock_node_typetables.Comment #7
dries commentedSo, is this useful given that we also call _block_rehash()?
Looking at _block_rehash() it doesn't look like it takes care of the block_role and block_node_type tables. Could be a bug ...
Comment #8
mr.baileysWe could call _block_rehash in the block_modules_uninstalled implementation, but
Comment #9
moshe weitzman commentedSUbscribe. IMo, this is worth doing. Lets be tidy about uninstall.
Comment #10
andypostThis patch already commited as part of #735900: Deleting module's blocks when module is uninstalled
See http://drupal.org/cvs?commit=338936
Table {block_node_type} is processed in #684774: Block visibility settings cannot be properly extended
Suppose this issue could be closed and continue at #735900: Deleting module's blocks when module is uninstalled
Comment #11
andypostAlso I'd like to point that some modules have no hook_schema() and hook_uninstall() so hook_modules_uninstalled never called!
Comment #12
mr.baileys@andypost, agreed that the changes discussed here are covered by #735900: Deleting module's blocks when module is uninstalled and #684774: Block visibility settings cannot be properly extended. Since obviously more work has gone into those issues, and parts have already been commited, I think it's best to mark this one as a duplicate of those and continue the discussion there.