The module appears to need check on the existence of valid box classes (maybe implement an invalid Box class similar to views) or uninstallation hooks (if already there, tell field boxes about these).

When disabling and uninstalling the Field Boxes module, I missed 3 Field Boxes blocks. The Boxes module loaded a NULL object and tried to use this throughout the module, leading to fatal errors everywhere: Most common was on hook_block_info() and hook_block_view(). After initially blaming entity api (also problematic due to stale caching), i turned on the error messages and found that this module was to blame.

Quick fix is to a) Delete all boxes first / failing that, b) Delete the invalid references from the database directly from the {box} table.

Comments

tirdadc’s picture

Deletion should only occur on uninstallation, not when the module is disabled. Better error handling is definitely needed when trying to instantiate a box from a type that is no longer defined, and I think the thread here is trying to address that. Ideally that should partially take care of this, and then we can add specific behavior for uninstallation.