From 2ac6b1ce97c39be6d942b811e9fc68f4754016c4 Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Thu, 5 Feb 2015 21:17:23 -0500 Subject: [PATCH] CRM-15920 - CiviReport - Correctly suppress a value in the case of > 2 repeating values are found --- CRM/Report/Form/Member/Detail.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index 4fbe191e84..f71767a3e0 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -402,18 +402,20 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); CRM_Core_Error::debug('noRepeats',$this->_noRepeats); + $repeatFound = FALSE; foreach ($rows as $rowNum => $row) { - + CRM_Core_Error::debug('repeatFound',$repeatFound . " " . $rowNum); + if ($repeatFound == FALSE || + $repeatFound < $rowNum - 1 + ) { + unset($checkList); + $checkList = array(); + } if (!empty($this->_noRepeats) && $this->_outputMode != 'csv') { // not repeat contact display names if it matches with the one // in previous row - $repeatFound = FALSE; CRM_Core_Error::debug('checklist',$checkList); foreach ($row as $colName => $colVal) { - if ($repeatFound == FALSE) { - unset($checkList); - $checkList = array(); - } if (in_array($colName, $this->_noRepeats) && $rowNum > 0 ) { @@ -426,7 +428,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { if($colName == 'civicrm_contact_exposed_id') { $rows[$rowNum]['civicrm_contact_sort_name'] = ""; } - $repeatFound = TRUE; + $repeatFound = $rowNum; } } if (in_array($colName, $this->_noRepeats)) { -- 2.25.1