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) »
  • Event API results being trimmed for Custom Fields
Pages: [1]

Author Topic: Event API results being trimmed for Custom Fields  (Read 630 times)

diegov

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 0
    • dotPro Tecnologia e Comunicação
  • CiviCRM version: 4.3.5
  • CMS version: Joomla! 3.1.x
  • MySQL version: 5.3
  • PHP version: 5.3
Event API results being trimmed for Custom Fields
October 02, 2013, 10:59:47 am
Hi,
I'm customizing the UserDashboard.tpl for Events (on civicrm/templates/CRM/Event/Page). My environment is Joomla! 2.5.x and CiviCRM 4.3.7.
I've included some calls on the smarty template successfully using the format "$row.event_start_date" or the full call like
Code: [Select]
{crmAPI var='result' entity='Contact' action='get' option='com_civicrm' task='civicrm/ajax/rest' sequential=1 contact_id=$row.contact_id}
{foreach from=$result.values item=Contact}
{$Contact.display_name}
{/foreach}

BUT, when I call the Custom Fields, the results are getting trimmed to the first character of each return string, e.g., if the result should be C219, only "C" shows up in the result page. I'm using the following syntax:
Code: [Select]
{crmAPI var='result' entity='Event' action='getvalue' option='com_civicrm' task='civicrm/ajax/rest' event_id=$row.event_id return='custom_26'}
{foreach from=$result.values item=Event}
{$Event.custom_26}
{/foreach}
I've tried some variations with no success. I've tried the same thing in the API explorer and generator and there the result IS OK, it returns the full string, not trimmed (API explorer call field looks like "/administrator/?option=com_civicrm&task=civicrm/ajax/rest&entity=Event&action=getvalue&debug=1&json=1&event_id=12&return=custom_28".

Please, Am I doing any mistake or does it looks like a bug?
« Last Edit: October 02, 2013, 01:42:43 pm by diegov »

diegov

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 0
    • dotPro Tecnologia e Comunicação
  • CiviCRM version: 4.3.5
  • CMS version: Joomla! 3.1.x
  • MySQL version: 5.3
  • PHP version: 5.3
Re: Event API results being trimmed for Custom Fields
October 12, 2013, 09:59:11 am
Bump, anyone? :)

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: Event API results being trimmed for Custom Fields
October 12, 2013, 11:36:27 am

might help to dump the object and see the contents, maybe using something like:

{php}print_r($Event);{/php}

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Event API results being trimmed for Custom Fields

This forum was archived on 2017-11-26.