From: Jon goldberg Date: Fri, 6 Feb 2015 02:17:23 +0000 (-0500) Subject: CRM-15920 - CiviReport - Correctly suppress a value in the case of > 2 repeating... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2ac6b1ce97c39be6d942b811e9fc68f4754016c4;p=civicrm-core.git CRM-15920 - CiviReport - Correctly suppress a value in the case of > 2 repeating values are found --- 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)) {