I've run into this twice this month and scratching my head. Read this image upside down: We hit post create Address hook -> my regex extension creates a Tag - all good; happy dance; then something in Core deletes my Tag :-( why?

enter image description here

  • At some point it must be calling a SQL query with the words delete and tag in the query. Assuming it's coming from the civi side somewhere can you put a hack in CRM_Core_DAO::executeQuery to do a case insensitive check for those words in the query and then log a debug_backtrace()? That might not catch it but it might.
    – Demerit
    Jul 3, 2019 at 0:14

1 Answer 1


That looks like your extension is deleting the entity tag?

  • No - it’s not the extension -the extension just prints all hooks that are invoked but the actual post delete tag happens elsewhere. It’s something like: post create address hook is invoked before post create individual hook - contact_id does exist when this post create address hook is invoked (in a memory layer perhaps?) - so it does let me create the tag (API call is happy) but then shortly after some bits are purged/cleaned up and my tag is deleted; Jul 2, 2019 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.