[Ref] Simplify params
authoreileen <emcnaughton@wikimedia.org>
Sun, 1 Nov 2020 23:45:36 +0000 (12:45 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 1 Nov 2020 23:51:02 +0000 (12:51 +1300)
As with
https://github.com/civicrm/civicrm-core/commit/0d74d91cd340b9f1ea2224119c748e372dffe245

pass the retrieved parameters to the single function rather than the id of the
object retrieved based on them

CRM/Core/Payment/PayPalProIPN.php

index ff8cf081785cdc81a0e1e81cba5397e2b5dec0ea..61c86b269e6649fb51c1187edf6cd530266b0445 100644 (file)
@@ -459,8 +459,8 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
 
       $this->single($input, [
         'related_contact' => $ids['related_contact'] ?? NULL,
-        'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
-        'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
+        'participant' => $ids['participant'] ?? NULL,
+        'contributionRecur' => $ids['contributionRecur'] ?? NULL,
       ], $objects, FALSE, FALSE);
     }
     catch (CRM_Core_Exception $e) {