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 (Moderator: Donald Lobo) »
  • custom search constructor called 3 time ?
Pages: [1]

Author Topic: custom search constructor called 3 time ?  (Read 859 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
custom search constructor called 3 time ?
June 11, 2009, 04:23:09 pm
Hi,

I'm calling &force=1 a custom search, and it is called 3 times. As I do some heavy sql init for that, that's not that good.

Is it possible to avoid it (eg factory) or is it on purpose ?


and where is the code called ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: custom search constructor called 3 time ?
June 11, 2009, 08:04:59 pm
AFAIK 3 queries are fired because first query will gives you count, second alphabetical pager and third for selector result.

Kurund
« Last Edit: June 11, 2009, 09:19:19 pm by Kurund Jalmi »
Found this reply helpful? Support CiviCRM

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: custom search constructor called 3 time ?
June 11, 2009, 11:57:17 pm
Is there a way to disable the count or pager (don't display them anyway) ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: custom search constructor called 3 time ?
June 12, 2009, 04:42:37 am
Quote
Is there a way to disable the count or pager (don't display them anyway) ?
Yes. For now you will have to modify http://fisheye.civicrm.org/browse/CiviCRM/branches/v2.2/CRM/Core/Config/Variables.php?r=19157 around line 383

UI is part of http://issues.civicrm.org/jira/browse/CRM-4514

Hth

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • custom search constructor called 3 time ?

This forum was archived on 2017-11-26.