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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
Pages: [1]

Author Topic: Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)  (Read 1069 times)

eengert

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Joomla 3.3
  • MySQL version: 5.5.30-30.1
  • PHP version: 5.4.26
Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
May 27, 2014, 11:14:20 am
I have completed an upgrade from Joomla 1.5/CiviCRM 3.4.8 to Joomla 3.3/CiviCRM 4.4.5.  Everything seems to have gone well.  However, when I open the Membership Report (Detail) many rows are missing.  I have tried different filters with no luck - even with no filters.  If I look at certain members which I know should be displayed, the data looks correct, so I can't figure out why they aren't being displayed.  I even checked the database records and everything looks fine on the member records. 

Could someone help me with this?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
May 28, 2014, 03:39:57 am
Can you see any pattern in the rows that are not displayed? Any reason why they might be missing?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

eengert

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Joomla 3.3
  • MySQL version: 5.5.30-30.1
  • PHP version: 5.4.26
Re: Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
June 03, 2014, 05:24:46 am
No, I've tried but haven't been able to identify a pattern. 

eengert

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Joomla 3.3
  • MySQL version: 5.5.30-30.1
  • PHP version: 5.4.26
Re: Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
June 03, 2014, 06:57:18 am
Actually, it looks like the missing rows may not have an associated record in the civicrm_membership_payment table.  But I checked, and they never had one even in the older versions before the upgrade, but the report worked in the older versions. 

I ran the report and had it output the sql.  When I run the sql and comment out the section that references the contributions and payments, it returns the missing rows.  The sql that works looks like this:

Code: [Select]
SELECT SQL_CALC_FOUND_ROWS contact_civireport.sort_name as civicrm_contact_sort_name, contact_civireport.id as civicrm_contact_id, membership_civireport.membership_type_id as civicrm_membership_membership_type_id,
email_civireport.email as civicrm_email_email
/*,
contribution_civireport.id as civicrm_contribution_contribution_id, contribution_civireport.currency as civicrm_contribution_currency  */
         FROM  civicrm_contact contact_civireport
               INNER JOIN civicrm_membership membership_civireport
                          ON contact_civireport.id =
                             membership_civireport.contact_id AND membership_civireport.is_test = 0
               LEFT  JOIN civicrm_membership_status mem_status_civireport
                          ON mem_status_civireport.id =
                             membership_civireport.status_id
              LEFT JOIN civicrm_email email_civireport
                        ON contact_civireport.id =
                           email_civireport.contact_id AND
                           email_civireport.is_primary = 1

              /*LEFT JOIN (
                  SELECT cc.*, cmp.membership_id as membership_id
                  FROM civicrm_membership_payment cmp
                    JOIN civicrm_contribution cc
                      ON cc.id = cmp.contribution_id
                  ORDER BY cc.receive_date DESC
                  ) contribution_civireport
                ON membership_civireport.id =
                  contribution_civireport.membership_id*/
 WHERE ( membership_civireport.join_date >= 20120501 ) AND ( mem_status_civireport.id IN (1, 2) )
 /*AND ( contribution_civireport.contribution_status_id IN (1) ) */
 AND contact_civireport.is_deleted = 0   GROUP BY contact_civireport.id, membership_civireport.membership_type_id   ORDER BY contact_civireport.sort_name, contact_civireport.id, membership_civireport.membership_type_id
 /*, contribution_civireport.receive_date*/ DESC

When I run the query without commenting out those sections, there are many rows missing in both the new and old databases.  So the query for this report must have changed in newer versions of CiviCRM.  Can you help me to understand what's going on and how to remedy this?
« Last Edit: June 03, 2014, 07:04:04 am by eengert »

eengert

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Joomla 3.3
  • MySQL version: 5.5.30-30.1
  • PHP version: 5.4.26
Re: Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)
June 03, 2014, 10:25:32 am
I think I figured it out.  As I was looking through the php file that builds the report output, I found that portion of the where clause and it has a comment with it that mentioned that it gets included when the Contribution field has some criteria set.  Sure enough, when I removed any contribution criteria, the full resultset is returned.  I guess that field is set in the criteria by default, so I just updated the report template so that it won't be set.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Membership Detail Report not accurate after upgrading to 4.4.5 (Joomla 3.3)

This forum was archived on 2017-11-26.