I have a rebuild trigger action that is failing. It is trying to create a trigger on civicrm_contributiion_recur. Clearly it has 2 i's and shouldn't. There is or was a trigger on the table without the extra i, so I figure it got stored in the db incorrectly. I went off in search of just where that stuff is stored but alas haven't found where.

So when you use hook_civicrm_triggerInfo to create a custom trigger where is that info stored?

Or when civi does an index rebuild how does it collect the list of tables and the bodies of the triggers? It needs to do this so it can combine any triggers civi core has with any custom triggers an extension or customization has added.


Triggers are stored in the information_schema, a virtual database provided by MySQL. This StackOverflow answer gives a pretty good overview.

| improve this answer | |
  • Yea, that's where mysql stores the info but when you use the hook_civicrm_triggerinfo civi must store that info somewhere. So in this case, the trigger doesn't exists now. The rebuild indexes dropped them all, but it tries to create one with the 2 i's. I'm pretty sure that trigger got created by summary reports and therefore has an entry where ever civi stores the info. Since mysql doesn't allow multiple triggers with the same action on the same table civi has to combine any it has in core code with any the user may have created, hence the need for the hook. – Paul-Tahoe Jun 20 '18 at 2:55
  • Summary reports is an extension isn't it? It probably calls that hook & has a typo in it – user4278 Jun 20 '18 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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