Problem/Motivation
delete() is not guaranteed to be called, since it's just a shortcut for passing the entity to the delete() method of the entity storage handler.
The code needs to be moved into a preDelete() method, not that one receives an array of entities, so you need to call getInstances() in a foreach loop.
Also, just like postSave(), it needs to call the clearCachedDefinitions() method.. otherwise the old block content entity would still be visible on the block page.. should not be too hard to write a test for it.. delete one, then go to admin/structure/block and make sure it's not there as a link anymore.
Beta phase evaluation
Bug | Because old block content entity would still be visible on the block page |
---|---|
Issue priority | Normal - doesn't break functionality |