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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • template_id and postProcess
Pages: [1]

Author Topic: template_id and postProcess  (Read 1023 times)

najoory

  • Guest
template_id and postProcess
February 21, 2010, 11:21:26 am
Hi all. I have questions about DB architecture and event templates.

In civicrm_event stored template_title only. How can  I get template_id from which was copied event data? I need this to cascade update of all events after parent template was changed. template_title is bad idea because it can be changed by user and reference will be losed. What about alter template_id into civicrm_event? I tried to do it myself but can't find a way to pass template_id to hook_postProcess.

Only way I found without DB hacks is use hidden custom value 'template_id' and hook_postProcess (or hook_buildForm and setDefaults?).

Thanks in advance for any help.

najoory

  • Guest
Re: template_id and postProcess
February 21, 2010, 12:38:29 pm
I had found that template_id accessible in $_POST from hook_civicrm_post and hook_civicrm_pre. So I choose DB hack of civicrm_event and UPDATE query with hook_civicrm_post. In any case thanks in advance for any comments or help.

UPD: I resolved my issue by adding template_id in CRM/Event/DAO/Event.php fields() instance. Now my civicrm_event.template_id(int 10) fills automatically. Hope this experience will be usefull for anyone ;)
« Last Edit: February 22, 2010, 03:02:15 am by najoory »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • template_id and postProcess

This forum was archived on 2017-11-26.