From: Donald A. Lobo Date: Sun, 14 Apr 2013 17:29:21 +0000 (-0700) Subject: fix notices on save X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4329191329629067caed94da2301da7c97ae0b2c;p=civicrm-core.git fix notices on save --- diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index ca17b63b20..492df4b0bb 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -67,7 +67,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { // creating a new relationship $dataExists = self::dataExists($params); if (!$dataExists) { - return NULL; + return array(FALSE, TRUE, FALSE, FALSE, NULL); } $relationshipIds = array(); foreach ($params['contact_check'] as $key => $value) { @@ -114,7 +114,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { ) ) { $duplicate++; - return array($valid, $invalid, $duplicate); + return array($valid, $invalid, $duplicate, $saved, NULL); } $validContacts = TRUE; @@ -1297,7 +1297,7 @@ SELECT count(*) AND is_current_member = 1"; $result = CRM_Core_DAO::singleValueQuery($query); if ($result < CRM_Utils_Array::value('max_related', $membershipValues, PHP_INT_MAX)) { - CRM_Member_BAO_Membership::create($membershipValues, CRM_Core_DAO::$_nullArray); + CRM_Member_BAO_Membership::create($membershipValues, CRM_Core_DAO::$_nullArray); } } } diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 30a8ee2123..672523a4df 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -530,7 +530,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { if ($employerId && ($isDisabled || $relChanged)) { CRM_Contact_BAO_Contact_Utils::clearCurrentEmployer($this->_values['current_employee_id']); } - + //if field key doesn't exists in params that means the user has unchecked checkbox, //hence fill FALSE to params $params['is_active'] = $isDisabled ? FALSE : TRUE; @@ -561,7 +561,8 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { //special case to handle if all checkboxes are unchecked $customFields = CRM_Core_BAO_CustomField::getFields('Relationship', FALSE, FALSE, $relationshipTypeId); - $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, + $params['custom'] = CRM_Core_BAO_CustomField::postProcess( + $params, $customFields, $this->_relationshipId, 'Relationship'