projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2423 from eileenmcnaughton/CRM-14139-static
[civicrm-core.git]
/
api
/
v3
/
Membership.php
diff --git
a/api/v3/Membership.php
b/api/v3/Membership.php
index 360d94685a82cc435e0df34f3ed77d558fe341a2..0f58352e0507cf914f23a9201635837f4cdace11 100644
(file)
--- a/
api/v3/Membership.php
+++ b/
api/v3/Membership.php
@@
-112,11
+112,11
@@
function civicrm_api3_membership_create($params) {
$action = CRM_Core_Action::ADD;
// we need user id during add mode
$ids = array ();
$action = CRM_Core_Action::ADD;
// we need user id during add mode
$ids = array ();
- if
(CRM_Utils_Array::value('contact_id', $params
)) {
+ if
(!empty($params['contact_id']
)) {
$ids['userId'] = $params['contact_id'];
}
//for edit membership id should be present
$ids['userId'] = $params['contact_id'];
}
//for edit membership id should be present
- if (
CRM_Utils_Array::value('id', $params
)) {
+ if (
!empty($params['id']
)) {
$ids['membership'] = $params['id'];
$action = CRM_Core_Action::UPDATE;
}
$ids['membership'] = $params['id'];
$action = CRM_Core_Action::UPDATE;
}
@@
-192,7
+192,7
@@
function civicrm_api3_membership_get($params) {
}
$activeOnly = CRM_Utils_Array::value('active_only', $params, $activeOnly);
}
$activeOnly = CRM_Utils_Array::value('active_only', $params, $activeOnly);
- if (
CRM_Utils_Array::value('contact_id', $params
) && !is_array($params['contact_id'])) {
+ if (
!empty($params['contact_id']
) && !is_array($params['contact_id'])) {
$membershipValues = _civicrm_api3_membership_get_customv2behaviour($params, $membershipTypeId, $activeOnly );
}
else {
$membershipValues = _civicrm_api3_membership_get_customv2behaviour($params, $membershipTypeId, $activeOnly );
}
else {
@@
-250,7
+250,7
@@
function _civicrm_api3_membership_relationsship_get_customv2behaviour(&$params,
$membershipValues[$membershipId]['membership_name'] = $membershipType['name'];
$membershipValues[$membershipId]['membership_name'] = $membershipType['name'];
- if (
CRM_Utils_Array::value('relationship_type_id', $membershipType
)) {
+ if (
!empty($membershipType['relationship_type_id']
)) {
$relationships[$membershipType['relationship_type_id']] = $membershipId;
}
$relationships[$membershipType['relationship_type_id']] = $membershipId;
}