CRM-20761: Formrule error when priceset is selected on contribution page
authorJitendra Purohit <jitendra@fuzion.co.nz>
Thu, 22 Jun 2017 14:00:40 +0000 (19:30 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Thu, 22 Jun 2017 14:00:40 +0000 (19:30 +0530)
CRM/Contribute/Form/ContributionPage/Amount.php
templates/CRM/Contribute/Form/ContributionPage/Amount.tpl

index a950ca545a9f0b6bfea356a69c39dbaca0643a34..042ade7a6e98fdc345beb397b354a6829aa2fea9 100644 (file)
@@ -351,7 +351,7 @@ class CRM_Contribute_Form_ContributionPage_Amount extends CRM_Contribute_Form_Co
     }
 
     //check for the amount label (mandatory)
-    if (!empty($fields['amount_block_is_active']) && empty($fields['amount_label'])) {
+    if (!empty($fields['amount_block_is_active']) && empty($fields['price_set_id']) && empty($fields['amount_label'])) {
       $errors['amount_label'] = ts('Please enter the contribution amount label.');
     }
     $minAmount = CRM_Utils_Array::value('min_amount', $fields);
index 5a3e24e99747b1991ce7119a854ddeab9a6987ec..43de518f8d5049cf6fac4cba982f1c63a45c8efa 100644 (file)
                 {if $futurePaymentProcessor}
                     <tr id="adjustRecurringFields" class="crm-contribution-form-block-adjust_recur_start_date"><th scope="row" class="label">{$form.adjust_recur_start_date.label}</th>
                         <td>{$form.adjust_recur_start_date.html}<br/>
-                         <div id="recurDefaults">
+                          <div id="recurDefaults">
                             <span class="description">{$form.pledge_default_toggle.label}</span>
                             <table class="form-layout-compressed">
                               <tr class="crm-contribution-form-block-date_of_recurring_contribution">
         if (element) {
           cj('#amountFields').hide();
         }
+        else {
+          cj('#amountFields').show();
+        }
         break;
 
       case 'is_pledge_active':