Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-07-15-32-51
authorTim Otten <totten@civicrm.org>
Mon, 7 Apr 2014 22:34:43 +0000 (15:34 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 7 Apr 2014 22:34:43 +0000 (15:34 -0700)
Conflicts:
api/v3/Membership.php

1  2 
api/v3/Job.php
api/v3/Membership.php

diff --cc api/v3/Job.php
Simple merge
index 528527f6912e7b88b25958e6f688804ceb897981,3dc34047307a69991145ae57fd4d701482e39b83..8f1c2572d3598bb7af921cd5754560bbe01d90ff
@@@ -192,7 -192,19 +192,19 @@@ function civicrm_api3_membership_get($p
    }
    $activeOnly = CRM_Utils_Array::value('active_only', $params, $activeOnly);
  
 -  if (CRM_Utils_Array::value('contact_id', $params) && !is_array($params['contact_id'])) {
+   //@todo replace this by handling in API layer - we should have enough info to do this
+   // between pseudoconstant & fk - see comments in format_params
+   $membershipTypeId = CRM_Utils_Array::value('membership_type_id', $params);
+   if (!$membershipTypeId) {
+     $membershipType = CRM_Utils_Array::value('membership_type', $params);
+     if ($membershipType) {
+       $membershipTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType',
+           $membershipType, 'id', 'name'
+       );
+     }
+   }
 +  if (!empty($params['contact_id']) && !is_array($params['contact_id'])) {
      $membershipValues = _civicrm_api3_membership_get_customv2behaviour($params, $membershipTypeId, $activeOnly );
    }
    else {