Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294185

BlockContent::delete() should be preDelete() and needs to clear plugin definitions like postSave()

$
0
0

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

Reference: https://www.drupal.org/core/beta-changes
BugBecause old block content entity would still be visible on the block page
Issue priorityNormal - doesn't break functionality

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 294185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>