Details
-
Type:
Improvement
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.4
-
Fix Version/s: 3.4.5
-
Component/s: CiviPledge, CiviReport
-
Labels:None
Description
Pledge summary report calls
SELECT v.label as label ,v.value as value FROM civicrm_option_value v, civicrm_option_group g WHERE v.option_group_id = g.id AND g.name = 'contribution_status' AND g.is_active = 1 AND v.value = 2 AND v.is_active = 1
31 times when I run it &
SELECT v.label as label ,v.value as value FROM civicrm_option_value v, civicrm_option_group g WHERE v.option_group_id = g.id AND g.name = 'contribution_status' AND g.is_active = 1 AND v.value = 2 AND v.is_active = 1
19 times (50 rows)
The patch below seems to fix it.
If I search the codebase for CRM_Core_OptionGroup::getLabel I find a small handful of instances where the non-cached getLabel function is being called instead of the appropriate pseudoConstant e.g. line 75 of CRM_Case_Form_Activity_ChangeCaseStatus
Index: CRM/Report/Form/Pledge/Summary.php
===================================================================
— CRM/Report/Form/Pledge/Summary.php (revision 35373)
+++ CRM/Report/Form/Pledge/Summary.php (working copy)
@@ -488,8 +488,9 @@
//handle status id
if ( array_key_exists( 'civicrm_pledge_status_id', $row ) ) {
if ( $value = $row['civicrm_pledge_status_id'] )
$entryFound = true;
}