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) »
  • error when calling civicrm_participant_update
Pages: [1]

Author Topic: error when calling civicrm_participant_update  (Read 778 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
error when calling civicrm_participant_update
June 11, 2011, 05:18:25 am
I am calling the participant update API as follows:


  $params = array(
                    'id'            => $pid,
                    'event_id'      => $eid,
                    'status_id'     => 2       
                    );


 $result_tmp = civicrm_participant_update($params);


But this blows up with the error:
Fatal error: Class 'CRM_Event_PseudoConstant' not found in /home/sholomnj/public_html/sites/all/modules/civicrm/CRM/Event/BAO/Participant.php on line 272

I am trying to mark the participant status as "attended"
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: error when calling civicrm_participant_update
June 11, 2011, 05:52:24 am
BTW: What would this API call look like if I switched to to the ajax/rest API ?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: error when calling civicrm_participant_update
June 11, 2011, 02:19:19 pm
In API v3 it would look like


  $params = array(
                    'id'            => $pid,
                    'event_id'      => $eid,
                    'status_id'     => 2 ,
                    'version'       =>3,
                    );


 $result_tmp = civicrm_api('Participant','Create',$params);


Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: error when calling civicrm_participant_update
June 12, 2011, 01:37:05 pm
I updated CiviCRM to version 3.4.2 and the API call worked. However, I am still struggling to switch this to an Ajax/REST API call instead of PHP. Any ideas?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

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

This forum was archived on 2017-11-26.