CRM-19478 Handle contribution_page_id = 'null' oddity.
authoreileen <emcnaughton@wikimedia.org>
Thu, 27 Oct 2016 08:15:10 +0000 (21:15 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 27 Oct 2016 08:16:41 +0000 (21:16 +1300)
I can't quite figure out the full flow here but this fix has been tested by Stoob & confirmed

CRM/Contribute/BAO/Contribution.php

index 1237d2576fd245fb1f5fe462a5a88e7f4971192d..3f6fc427cad0aec507425ce8901f9329ae14c851 100644 (file)
@@ -2148,7 +2148,8 @@ LEFT JOIN  civicrm_contribution contribution ON ( componentPayment.contribution_
       //CRM-18805 -- Contribution page not recorded on recurring transactions, Recurring contribution payments
       //do not create CC or BCC emails or profile notifications.
       //The if is just to be safe. Not sure if we can ever arrive with this unset
-      if (isset($contribution->contribution_page_id)) {
+      // but per CRM-19478 it seems it can be 'null'
+      if (isset($contribution->contribution_page_id) && is_numeric($contribution->contribution_page_id)) {
         $contributionParams['contribution_page_id'] = $contribution->contribution_page_id;
       }