diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index d7a13692b65f..c5484857c30e 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -336,7 +336,8 @@ public function main() { Civi::log()->debug('PayPalIPN: Received (ContactID: ' . $ids['contact'] . '; trxn_id: ' . $input['trxn_id'] . ').'); - if ($this->retrieve('membershipID', 'Integer', FALSE)) { + // Debugging related to possible missing membership linkage + if ($contributionRecurID && $this->retrieve('membershipID', 'Integer', FALSE)) { $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($contributionRecurID); $membershipPayment = civicrm_api3('MembershipPayment', 'get', [ 'contribution_id' => $templateContribution['id'],