From: Eileen McNaughton Date: Mon, 27 Oct 2014 02:38:11 +0000 (+1300) Subject: CRM-15527 tests indicate ['membership'] is likely to be an array at this stage X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dccb668eab0b59eb71945f4d862dee2f602a19c6;p=civicrm-core.git CRM-15527 tests indicate ['membership'] is likely to be an array at this stage --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 268187dd22..63c501a683 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2136,9 +2136,13 @@ WHERE contribution_id = %1 "; $entity = 'contribution'; $entityID = $ids['contribution']; } - if (isset($ids['membership']) && $ids['membership']) { + if (!empty($ids['membership'])) { + //not sure whether is is possible for this not to be an array - load related contacts loads an array but this code was expecting a string + // the addition of the casting is in case it could get here & be a string. Added in 4.6 - maybe remove later? This AuthorizeNetIPN & PaypalIPN tests hit this + // line having loaded an array + $ids['membership'] = (array) $ids['membership']; $entity = 'membership'; - $entityID = $ids['membership']; + $entityID = $ids['membership'][0]; } $url = $paymentObject->subscriptionURL($entityID, $entity);