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) »
  • invalid error callback using API from smarty
Pages: [1]

Author Topic: invalid error callback using API from smarty  (Read 1419 times)

andrewhunt

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 13
    • AGH Strategies
  • CiviCRM version: all of 'em
  • CMS version: Drupal, Joomla, and WordPress
invalid error callback using API from smarty
February 05, 2010, 10:10:36 am
I was editing the /CRM/Custom/Page/CustomDataView.tpl template and added an API call:
{crmAPI entity='contact' action="get" var="contacts" contact_id=$contactId return="custom_21"}

It returned the following error:
user warning: invalid error callback in /srv/www/impactmail.org/public_html/sites/all/modules/civicrm/packages/PEAR.php on line 350.

I haven't used the API from Smarty before, so I may just be missing something.  Do any of you all know what's going on here?

It looks like someone had a similar issue at:
http://forum.civicrm.org/index.php/topic,11279.0.html

I'm using 3.1.1 on Drupal 6.15.
You can find me at AGH Strategies.
Need help now?  Civi911 is your go-to for CiviCRM support.

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: invalid error callback using API from smarty
February 05, 2010, 11:09:33 am

1. use this patch here:

http://fisheye2.atlassian.com/browse/CiviCRM/branches/v3.1/CRM/Core/Smarty/plugins/function.crmAPI.php?r1=26123&r2=26155

(do not add the debug statements, that was a mistake) to get rid of the error

2. to access the variable, u'll need to add this to the template after the crmAPI call

XXXX: {$contacts.$contactId.custom_21}

3. i just tried the above on my 3.1 sandbox

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

andrewhunt

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 13
    • AGH Strategies
  • CiviCRM version: all of 'em
  • CMS version: Drupal, Joomla, and WordPress
Re: invalid error callback using API from smarty
February 05, 2010, 01:43:40 pm
Awesome, thanks.  Works fine now.
You can find me at AGH Strategies.
Need help now?  Civi911 is your go-to for CiviCRM support.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • invalid error callback using API from smarty

This forum was archived on 2017-11-26.