CRM-17497 fix - Adding relationship with multi-valued custom field fails
authormonishdeb <monish.deb@webaccessglobal.com>
Wed, 4 Nov 2015 08:07:59 +0000 (13:37 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Wed, 4 Nov 2015 08:07:59 +0000 (13:37 +0530)
https://issues.civicrm.org/jira/browse/CRM-17497

CRM/Contact/BAO/Relationship.php

index f2946a6079ac6d272f92a5ac0dab77db7fa332f4..adb8dc0a60ce823cd4e0724619bc3280874774fa 100644 (file)
@@ -1474,11 +1474,10 @@ LEFT JOIN  civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
 
     $query = 'SELECT * FROM `civicrm_membership_status`';
     if ($active) {
-      $query .= 'WHERE `is_current_member` = 1 OR `id` = %1 ';
+      $query .= ' WHERE `is_current_member` = 1 OR `id` = %1 ';
     }
 
-    $params[1] = array($pendingStatusId, 'String');
-    $dao = CRM_Core_DAO::executeQuery($query, $params);
+    $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($pendingStatusId, 'Integer')));
 
     while ($dao->fetch()) {
       $membershipStatusRecordIds[$dao->id] = $dao->id;