fuzionnz / contrib.showallthehooks

Module demonstrates CiviCRM hooks
Other
3 stars 4 forks source link

WordPress support #1

Closed xurizaemon closed 5 years ago

xurizaemon commented 7 years ago
christianwach commented 7 years ago

@xurizaemon This is proving pretty useful. For example, I discovered that hook_civicrm_postProcess fires twice when submitting the "Online Registration" section of an Event form. I'm pretty sure it shouldn't be doing that!

Which got me to wondering... could this be refined such that it audits the hooks that CiviCRM fires? Or are the rules for this too complex to code?

Just a thought.

xurizaemon commented 7 years ago

I'm open to any additions people want to propose - initially it was called "civideveloper" but I didn't want to claim that namespace until it did more than just show hooks.

So: yes, and also check out some of the other issues like #3 #6 #7 #8 - maybe you could open a new one for auditing and outline the sort of audit checks you'd envision? (Maybe "these hooks should fire once per page, these are ok to fire twice?")

Are the rules complex? IDK! But if we start making a list - "hook_civicrm_config should only fire once per run" - then we can find out 🔎

xurizaemon commented 7 years ago

The way civi processes forms I think means each submit results in a 302 to the results - this might make it look like a hook ran twice? But I still wouldn't expect postProcess to run twice unless there were two form submits.