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) »
  • Discussion (deprecated) »
  • Documentation, Book and Training Resources (Moderator: Michał Mach) »
  • Wiki references to API 'search' method - out-dated?
Pages: [1]

Author Topic: Wiki references to API 'search' method - out-dated?  (Read 774 times)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Wiki references to API 'search' method - out-dated?
November 22, 2013, 02:57:16 am
Not sure if this is something which needs fixing, or just highlighting a gap in our understanding of Civi and smarty, but when building some custom templates, we tried to follow the example from http://wiki.civicrm.org/confluence/display/CRMDOC/Smarty+interface:

Code: [Select]
For example, if you want to display a list of contacts\

{crmAPI entity='contact' action="search" var="contacts"}
<ul>
{foreach from=$contacts.values item=contact}
<li id="contact_{$contact.contact_id}">{$contact.sort_name}</li>
{/foreach}</ul>

... and this doesn't work. Replacing action="search" with action="get" works fine. Or rather it works provided you also set sequential="0" in the API call because of the change in the default behaviour of Civi 4.4.x

My first thought was to just edit the wiki page, making a reference to the issue around sequential and replacing "search" with "get" (assuming "search" was either an artifact from a previous version of the API, or just plain wrong), but then I got cold feet in case it was in fact an acceptable method that we just weren't using right.

I'm happy to make the edit - provided someone in the know can greenlight it.

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: Wiki references to API 'search' method - out-dated?
November 22, 2013, 04:54:59 am
I think you can go ahead and edit wiki. :) search is deprecated.

S.
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Documentation, Book and Training Resources (Moderator: Michał Mach) »
  • Wiki references to API 'search' method - out-dated?

This forum was archived on 2017-11-26.