Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#2 | entity_revert.patch | 1.89 KB | fago |
#1 | entity_revert.patch | 1.44 KB | fago |
Comments
Comment #1
fagoAttached patch fixes it for me + improves hook_{ENTITY_TYPE}_delete() to receiver a further parameter, delete. Not sure whether we should do so or better set something like
$entity->is_revert
, analogous to $entity->is_rebuild.Comment #2
fagoI've further improved the patch so we don't need an extra parameter in the deletion hook, but can just check whether the entity is in code during deletion. For that to work also in the case of feature-module-disabling I've added an extra check, so that the status is updated before the deletion hook is invoked.
Thus, modules can just rely on the entity-status to figure out when it is a revert or not.
-> Patch remains working + tests are green -> committed.