[Ref] Use direct version of participant id
authoreileen <emcnaughton@wikimedia.org>
Fri, 30 Oct 2020 07:19:29 +0000 (20:19 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 30 Oct 2020 07:19:29 +0000 (20:19 +1300)
ids['Participant'] is taken from the url. It is then passed to loadRelatedObjects
where
https://github.com/civicrm/civicrm-core/blob/0bd5e6bfbe8f339dbe066e3e96e00760c93a57e2/CRM/Contribute/BAO/Contribution.php#L2890
loads an object based on it. We then set ids too the object's id - which is a long way around to
using the paramter we started from. This does that

CRM/Core/Payment/PayPalIPN.php

index 9e1a6050e36e2a5941abd6002ebce085f94d43bf..f605fffbbeeaa48d582b4b22b53c04d175351b60 100644 (file)
@@ -357,7 +357,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
       }
       $this->single($input, [
         'related_contact' => $ids['related_contact'] ?? NULL,
-        'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
+        'participant' => $ids['participant'] ?? NULL,
         'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
       ], $objects['contribution']);
     }