Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.0
-
Fix Version/s: 4.2.1
-
Component/s: None
-
Labels:None
Description
Steps:
1 ) Use hook_civicrm_triggerInfo (or a facsimile) to define a trigger which runs before inserting on civicrm_email
2) Rebuild triggers. This creates a new trigger as expected.
3) Modify hook_civicrm_triggerInfo to use 'after insert' instead of 'before insert'
4) Rebuild triggers. The new after-insert trigger is created but old before-insert trigger remains.
Step #3 (the modification to hook_civicrm_triggerInfo) can be many different things – such as removing the triggerInfo entirely, changing the 'event', or changing the 'when'.
This was observed in a case where only one module had defined a trigger for the given combination ($table,$event,$when). If there are multiple modules which attach triggers to the same combination, then the stale code may be properly cleaned. In practice, sites with detailed record logging have many triggers already declared – so those sites are less likely to experience the bug.