Closed (fixed)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2014 at 08:45 UTC
Updated:
17 May 2014 at 10:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedComment #2
cs_shadow commentedAttaching a quick patch where
hook_entity_delete()is invoked before deleting field data. Also added a short comment forfield_attach_delete, if that helps to understand the code better.Comment #3
joachim commentedThis is going to need a reroll due to the refactoring that took place in #2202969: clean up flag() and its low-level helpers. I should have marked this as postponed until that one was fixed -- sorry!
Comment #4
cs_shadow commentedRerolled the patch against latest HEAD.
Comment #5
joachim commentedThanks for working on a patch!
I'm not sure the order is right. The entity should still exist in the DB when field API and hooks are invoked.
Look at node_delete() -- we should do the same as that, for consistency.
Comment #6
cs_shadow commentedChanged the order as in node_delete().
Order in node_delete:
New order in flag:
Comment #7
joachim commentedThat's not node_delete(), that's the code for deleting a node *type*.
Though node_delete() just calls https://api.drupal.org/api/drupal/modules!node!node.module/function/node.... But that definitely deletes the record after invoking hooks.
Comment #8
cs_shadow commentedSorry, looked at the wrong function earlier. This one follows the order of deleting nodes. Now the order is:
Comment #9
joachim commentedPerfect! Thanks for working on this.
Comment #11
cs_shadow commented@joachim thanks! Finally got it right.