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) »
  • Event API integration from 2.0 -> 2.1
Pages: [1]

Author Topic: Event API integration from 2.0 -> 2.1  (Read 1260 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Event API integration from 2.0 -> 2.1
October 03, 2008, 10:53:39 am
I'm using the 2nd example from the 'List Public Events by Event Type in a Block' on this page: http://wiki.civicrm.org/confluence/display/CRMDOC/Using+CiviCRM+APIs+-+Code+Snippets

There is one piece that doesn't seem to be working now that I upgraded to 2.1:
Code: [Select]
$display .= l($title_place.' '.$title_desc, 'civicrm/event/info', array(), 'reset=1&id='.$event['id']);
My links are just showing up with urls of 'civicrm/event/info' and no event id is coming through anymore....Ideas on what I  need to change? I will update the wiki once I get it working again...

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Event API integration from 2.0 -> 2.1
October 13, 2008, 09:38:26 am
Anyone, anyone?? Still can't figure out why this isn't working going from 2.0 to 2.1...losing this functionality is breaking my whole site!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Event API integration from 2.0 -> 2.1
October 13, 2008, 10:40:44 am
Hi,

But do you fetch events ?

I don't know how familiar you are with php, but can you add a print_r($event), to see what is in it ?

X+

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

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Event API integration from 2.0 -> 2.1
October 13, 2008, 11:12:17 am
hey xavier,

yeah that wasn't the problem as i knew i was getting the id. but your post provoked me to think a little harder since obviously it was working from the civicrm side :)

so i finally figured out that it was drupal (duh) and the l() function, which changed in drupal 6.

basically, i changed:
Code: [Select]
$display .= l($title_place.' '.$title_desc, 'civicrm/event/info', array(), 'reset=1&id='.$event['id']);to:

Code: [Select]
        $display .= l($title_place.' '.$title_desc, 'civicrm/event/info', array('query' => 'reset=1&id='.$event['id']) );

to reflect the changes in drupal 6. these are discussed here: http://drupal.org/node/114774#url

I am also going to update the code snippets on the civicrm wiki to show a d6 example, too.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Event API integration from 2.0 -> 2.1

This forum was archived on 2017-11-26.