diff --git a/softcreditcustomfields.php b/softcreditcustomfields.php index 7c44445..1099c50 100644 --- a/softcreditcustomfields.php +++ b/softcreditcustomfields.php @@ -177,8 +177,15 @@ function softcreditcustomfields_civicrm_buildForm($formName, &$form) { CRM_Core_Region::instance('page-footer')->add(array( 'template' => "CRM/Contribute/Form/SoftCredit-Custom.tpl", )); + for ($blockId = 1; $blockId <= 10; $blockId++) { - $entityId = NULL;//CRM_Utils_Array::value('id', CRM_Utils_Array::value($blockId, $softCredits)); + $entityId = CRM_Utils_Array::value( + 'soft_credit_id', + CRM_Utils_Array::value( + $blockId, + CRM_Utils_Array::value('soft_credit', $form->_softCreditInfo) + ) + ); _softcreditcustomfields_addCustomDataToForm($form, $entityId, $blockId); }