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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Activity API functions?
Pages: [1]

Author Topic: Activity API functions?  (Read 2088 times)

SteveM

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 3
    • OpenConcept Consulting, Inc.
Activity API functions?
February 26, 2008, 02:39:53 pm
I note that the Activity API functions are described in the docs as 'deprecated' -- are there new functions that replace them?

Also: the docs claim that they are still available in 1.9, but attempting to use crm_create_activity() in my install of 1.9.13019 fails with the message "Failed opening required 'CRM/Core/DAO/ActivityType.php'".

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: Activity API functions?
February 26, 2008, 05:06:22 pm

Hopefully it should work in 1.9. Can you try adding:

require_once 'CRM/Core/DAO/ActivityType.php'; above the line where u get the error

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

SteveM

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 3
    • OpenConcept Consulting, Inc.
Re: Activity API functions?
February 26, 2008, 05:47:21 pm
I considered that, but the file doesn't actually exist in any of my existing installs, nor in a freshly-downloaded 1.9.13019 version. I should have mentioned that as well!

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: Activity API functions?
February 26, 2008, 09:46:42 pm

argh

this is definitely way beyond broken in 1.9. We'll ensure that this function does work in 2.0

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

Manish Zope

  • I’m new here
  • *
  • Posts: 18
  • Karma: 4
Re: Activity API functions?
February 26, 2008, 11:10:42 pm
Steve :
crm_create_activity API is deprecated
It is replaced by v2 API civicrm_activity_create

Lobo :
civicrm_activity_create is working fine in 2.0 (r 13455)

SteveM

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 3
    • OpenConcept Consulting, Inc.
Re: Activity API functions?
February 27, 2008, 08:44:40 am
The v2 API does indeed work. Unfortunately it does not create activity history records because it calls the CRM_Activity_BAO_Activity::add method directly. So I have wound up using this instead:

      require_once( 'CRM/Activity/BAO/Activity.php' );
      $ids = array();
      $activity = CRM_Activity_BAO_Activity::createActivity( $params, $ids, $type_id );

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Activity API functions?
February 27, 2008, 11:37:03 pm
V2 api's are compatible with CiviCRM v2.0 schema. We have dropped "civicrm_activity_history"  table in v2.0. Hence it will not created history record.

HTH

kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Activity API functions?

This forum was archived on 2017-11-26.