CRM-15296 - fix to make tests pass since this prevents an e-Notice BUT
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 30 Sep 2014 07:39:33 +0000 (20:39 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 30 Sep 2014 09:16:07 +0000 (22:16 +1300)
need to check with Joe as the e-Notice seems to expose a real error and we should possibly
reverse this & uncomment a couple of lines in the tests that are tied up with this too
(in ContributionPageTest). the issue is that pending recurring contributions WITH memberships
have no line items

CRM/Contribute/BAO/Contribution.php

index c3c9e086cc294d5245d80e03dd192f00f955200d..ead367d0ca9c7ee69bce3966a0c42eb2396cb8e1 100644 (file)
@@ -2931,6 +2931,13 @@ WHERE  contribution_id = %1 ";
           'entity_table' => 'civicrm_financial_item',
           'financial_trxn_id' => $trxn->id,
         );
+        if (empty($params['line_item'])) {
+          //CRM-15296
+          //@todo - check with Joe regarding this situation - payment processors create pending transactions with no line items
+          // when creating recurring membership payment - there are 2 lines to comment out in contributonPageTest if fixed
+          // & this can be removed
+          return;
+        }
         foreach ($params['line_item'] as $fieldId => $fields) {
           foreach ($fields as $fieldValueId => $fieldValues) {
             $fparams = array(