CRM-15047 Fix for Attempting to record ANY contribution throws a fatal error
authorRohan Katkar <rohan.katkar@webaccess.co.in>
Wed, 30 Jul 2014 03:57:57 +0000 (09:27 +0530)
committerRohan Katkar <rohan.katkar@webaccess.co.in>
Wed, 30 Jul 2014 03:57:57 +0000 (09:27 +0530)
CRM/Contribute/Form/SoftCredit.php

index f725f951797b4d688b1726eee82a64483e92f295..ad4f68cd56868cce9830e402fc044ed69e772399 100644 (file)
@@ -106,7 +106,7 @@ class CRM_Contribute_Form_SoftCredit {
     if ($form->getAction() & CRM_Core_Action::UPDATE) {
       $form->_softCreditInfo = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($form->_id, TRUE);
     }
-    elseif (property_exists($form, "_pledgeID")) {
+    elseif (property_exists($form, "_pledgeID") && $form->_pledgeID) {
       //Check and select most recent completed contrubtion and use it to retrieve
       //soft-credit information to use as default for current pledge payment, CRM-13981
       $pledgePayments = CRM_Pledge_BAO_PledgePayment::getPledgePayments($form->_pledgeID);