From dccb668eab0b59eb71945f4d862dee2f602a19c6 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 27 Oct 2014 15:38:11 +1300 Subject: [PATCH] CRM-15527 tests indicate ['membership'] is likely to be an array at this stage --- CRM/Contribute/BAO/Contribution.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.25.1