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.
Follow-up to #1035410: Flag any entity:
We need to generalize flag_node_type_delete() to http://api.drupal.org/api/drupal/modules!field!field.api.php/function/ho...
Special handling may be needed for nodes and comments, on the other hand, hook_field_attach_delete_bundle() may be invoked once for node and comment -- needs checking.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1689686.flag_.clean-up-on-bundle-delete.patch | 930 bytes | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedThere's actually a bug here too:
This will remove types from flags for entities other than the current one if they happen to match.
Eg, both node and product entities have a bundle 'foo'. Both have flags. Deleting the product foo bundle will also zap the node flag's applicability to the node foo bundle.
Comment #2
joachim CreditAttribution: joachim commentedCommitted this patch.
Tested it with deleting a node type 'foo' when there's also a vocabulary 'foo' and vice versa. Will also remove the comment type from comment flags, as hook_field_attach_delete_bundle() is also invoked for comments when a node type is deleted.