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) »
  • Create event hooks to set initial location information
Pages: [1]

Author Topic: Create event hooks to set initial location information  (Read 945 times)

tklawsuc

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.06
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.2/5.3
Create event hooks to set initial location information
December 19, 2011, 07:16:41 am
Is there a reason why only the civicrm_validate hook is called when creating an event (the event info page)? The expected hooks are trigger when you click save on the location page. I thought it was because you can cancel the event creation on the location page but the event is already created before the location page is loaded. Also pressing cancel doesn't actually cancel the creation of the event it just ignores the location setup step.

I need to trigger the post hook after the event is created and before the location page is loaded. I have a custom field on the event info page to select an organization which I then want to use to set the default location information. Any suggestions on how I can achieve this if the hooks aren't available?

While on the subject, is it possible to create an event without having to go to the location page at all? i.e. We have a select field on the event info page where you select a room for the event and the address information could be then populated from that information using a hook/api.

Thanks,
Tom

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Create event hooks to set initial location information
December 19, 2011, 05:31:49 pm

this is a bug. can you please check and see if you can reproduce this issue for v4.1

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Create event hooks to set initial location information
December 20, 2011, 05:26:05 am
Sounds like an interesting and useful feature. Could you share the code ?

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

tklawsuc

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.06
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.2/5.3
Re: Create event hooks to set initial location information
December 20, 2011, 01:36:40 pm
My apologies...looks like my netbeans debugger was not picking up breakpoints on a switch statement. The hooks are firing fine in 4.0.7. I will post my solution to these requirements once completed in case anyone else needs this functionality.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Create event hooks to set initial location information

This forum was archived on 2017-11-26.