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.
inline_entity_form.module contains the following:
/**
* Implements hook_entity_delete().
*
* Deletes referenced entities if needed.
*
* @todo Remove when there's a stable contrib module for this.
*/
function inline_entity_form_entity_delete($entity, $type) {
I agree and think this functionality is not specific to inline_entity_form at all. So I wrote http://drupal.org/project/field_referenced_delete which works out of the box with entityreference fields, and should eventually support any fields that use the 'foreign keys' in hook_field_schema() correctly.
Comments
Comment #1
bojanz CreditAttribution: bojanz commentedAwesome, just what the doctor ordered.
I need to:
1) Confirm that the module works for product reference and line item reference fields, and add support if it is missing.
2) Add the module to Kickstart
3) Commit your patch.
So #1 is my main blocker and I will try to get to that soon.
Comment #2
Dave ReidGreat. I tested that the module's API supports product reference fields, so I assume line items would work as well. It would be good to have someone more comfortable with those fields to actually test it and make sure the functionality works too.
Comment #3
Dave ReidJust fixed a bug in 7.x-1.x that made the module's settings not show up for fields that don't actually have any settings, which affected line item reference fields. But fixed now.