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.
When an entity is being deleted the related flagging records are deleted in bulk by _flag_entity_delete()
, but other modules are not notified about this. For example, we had some custom notifications related to flagging_id
s and we ended up with broken notifications when some flagging entities couldn't be loaded.
See the existing hooks invoke in flag_flag::flagging_delete()
, we need something similar.
Comment | File | Size | Author |
---|---|---|---|
#1 | d7-flag-hook-flag-entity-delete-2537540-do-not-test.patch | 1.44 KB | ehegedus |
Comments
Comment #1
ehegedus CreditAttribution: ehegedus commentedHook implementation we used to fix our issues.
Comment #2
joachim CreditAttribution: joachim commentedThanks for the patch!
Unfortunately, this is an area of Flag that's currently not really working properly -- see #2052947: deleting a Flagging via deleting an entity does not delete Flagging fields data. When that issue is fixed, it's likely to to throw off the patch here. Also, it would probably mean it's not needed, as hook_flag_unflag() would get invoked properly.
(BTW, please don't use random tags on issues.)