CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Which objects call hook_civicrm_pre? Can I hook on Event Type creation?
Pages: [1]

Author Topic: Which objects call hook_civicrm_pre? Can I hook on Event Type creation?  (Read 1599 times)

joachim

  • Guest
Which objects call hook_civicrm_pre? Can I hook on Event Type creation?
August 08, 2008, 03:44:33 am
The documentation at http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification says:

Quote
* These hooks will be called on any operation on some core CiviCRM objects.

Which ones?

It doesn't seem to be getting called for creation of a new Event Type. Is there a way to get Drupal to respond when new event types are created -- I need to create a corresponding content type.

dougall

  • Guest
Re: Which objects call hook_civicrm_pre? Can I hook on Event Type creation?
August 17, 2008, 02:34:00 am
If you grep inside the files in civicrm/CRM for "CRM_Utils_Hook::pre" you can see exactly what fires off the the pre hooks (and where):
Code: [Select]
  grep -rn "CRM_Utils_Hook::pre" civicrm/CRM/*

For CiviCRM 2.0.2 I can see a pre hook call for Event creation but not Event Type creation.

It appears that Event Types are stored as an Option Group (in civicrm_option_group and civicrm_option_value), so if you want a CiviCRM pre hook on Event Type creation then perhaps you could add a CRM_Utils_Hook::pre(...) call to somewhere suitable in the function addOptionValue(...) inside CRM/Core/OptionValue.php (in a similar fashion to the other pre hook calls).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Which objects call hook_civicrm_pre? Can I hook on Event Type creation?

This forum was archived on 2017-11-26.