CRM-17654 Fix issue where it wasn't storing all selected relationship types in db
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 14 Dec 2015 02:15:29 +0000 (02:15 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Mon, 14 Dec 2015 02:19:08 +0000 (02:19 +0000)
CRM/Report/Form/Contact/Relationship.php

index 7ffaace1c294f5a68d2af4b0223bc371fa26bf7d..fc506efdebaebc216708eb6ab8d8682eca84a7cd 100644 (file)
@@ -558,10 +558,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
     $this->beginPostProcess();
 
     $this->relationType = NULL;
-    $relType = array();
+    $originalRelationshipTypeIdValue = $this->_params['relationship_type_id_value'];
     if (!empty($this->_params['relationship_type_id_value'])) {
       $relationshipTypes = array();
       $direction = array();
+      $relType = array();
       foreach ($this->_params['relationship_type_id_value'] as $relationship_type) {
         $relType = explode('_', $relationship_type);
         $direction[] = $relType[1] . '_' . $relType[2];
@@ -583,9 +584,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
     $this->formatDisplay($rows);
     $this->doTemplateAssignment($rows);
 
-    if (!empty($relType)) {
+    if (!empty($originalRelationshipTypeIdValue)) {
       // store its old value, CRM-5837
-      $this->_params['relationship_type_id_value'] = implode('_', $relType);
+      $this->_params['relationship_type_id_value'] = $originalRelationshipTypeIdValue;
     }
     $this->endPostProcess($rows);
   }