From 8860e13b0df53ba3f1fe73aeb4db8b7564d61815 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 9 Aug 2017 18:44:11 +0530 Subject: [PATCH] CRM-21047, fixed JS error ---------------------------------------- * CRM-21047: TypeError: financialtypeIds is undefined, on contribution form https://issues.civicrm.org/jira/browse/CRM-21047 --- templates/CRM/Contribute/Form/Contribution.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index e9428e9734..844fda1c0c 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -572,7 +572,9 @@ function buildAmount( priceSetId, financialtypeIds ) { cj("#price_set_id option[value='']").html( manual ); cj('label[for="total_amount"]').text('{/literal}{ts}Price Sets{/ts}{literal}'); - cj("#financial_type_id option[value="+financialtypeIds[priceSetId]+"]").prop('selected', true); + if (financialtypeIds) { + cj("#financial_type_id option[value="+financialtypeIds[priceSetId]+"]").prop('selected', true); + } cj(".crm-contribution-form-block-financial_type_id").css("display", "none"); } -- 2.25.1