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 (Moderator: Dave Greenberg) »
  • Grant tab only showing one record
Pages: [1]

Author Topic: Grant tab only showing one record  (Read 1140 times)

mbriney

  • I’m new here
  • *
  • Posts: 21
  • Karma: 2
  • Technical Product Manager / VP at Edelman
    • Edelman Public Relations
Grant tab only showing one record
August 02, 2011, 06:43:46 am
I am having issues with the grant tab only displaying one record in the listing for an individual despite there being multiple grants.  I have been looking through the CRM/grant code to try and see if a limit was specified but cannot find one.  Does anyone know in what file the query is built?

Thanks,
-Matt
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Grant tab only showing one record
August 02, 2011, 06:49:14 pm
Hi Matt -
CRM/Grant/Page/Tab.php calls CRM/Grant/Selector/Search.php which eventually uses CRM/Contact/BAO/Query.php. You can dump the query object from the Grants tab by adding this in the at the bottom of the __construct function in Search.php:

       crm_core_error::debug('$this->_query', $this->_query);
        exit();

Or enable MySQL query logging and look for the query there.
Protect your investment in CiviCRM by  becoming a Member!

Tom Elwertowski

  • I’m new here
  • *
  • Posts: 3
  • Karma: 1
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.58
  • PHP version: 5.2.15
Re: Grant tab only showing one record
August 06, 2011, 07:00:03 pm
I just hit this issue myself. Both the grant tab and grant find will display only one grant per contact even though the total grant count is correct.

This code fragment of searchQuery in CRM/Contact/BAO/Query.php is adding a DISTINCT expression to the query:

if ( ! $count ) {
  $this->_useDistinct = true;
}


-Tom

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: Grant tab only showing one record
August 06, 2011, 07:02:36 pm

I think i fixed this issue in svn a few days ago. Can you check on drupal.demo.civicrm.org

this will be part of the next release. Would be great if someone could confirm that this is fixed :)

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

Tom Elwertowski

  • I’m new here
  • *
  • Posts: 3
  • Karma: 1
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.58
  • PHP version: 5.2.15
Re: Grant tab only showing one record
August 06, 2011, 07:57:29 pm
The problem still exists on drupal.demo.civicrm.org (35552)

Find Grants (and the Contact Grant tab) will find two but list only one. :(

-Tom

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: Grant tab only showing one record
August 08, 2011, 01:58:02 pm

This is now fixed as part of CRM-8572

can u please retest on drupal.demo :)

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

Tom Elwertowski

  • I’m new here
  • *
  • Posts: 3
  • Karma: 1
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.58
  • PHP version: 5.2.15
Re: Grant tab only showing one record
August 09, 2011, 08:07:47 am
It's working now.  :) Happy to see this fixed so quickly.

Thanks,
-Tom

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Grant tab only showing one record

This forum was archived on 2017-11-26.