CRM-21665 Fix check number toggle on Edit form when context is search
authorSunil Pawar <sunil@cividesk.com>
Tue, 30 Jan 2018 09:07:28 +0000 (14:37 +0530)
committerSunil Pawar <sunil@cividesk.com>
Tue, 30 Jan 2018 09:07:28 +0000 (14:37 +0530)
CRM/Contribute/BAO/Query.php
templates/CRM/Contribute/Form/Search/Common.tpl

index f3e9fabf7e9add5450dfab1b640b836dda9298e8..a60aea1bda2f3ce843c12e954a091caf798fd51b 100644 (file)
@@ -927,8 +927,11 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
       FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple', 'placeholder' => ts('- any -'))
     );
 
-    $form->addSelect('payment_instrument_id',
-      array('entity' => 'contribution', 'multiple' => 'multiple', 'label' => ts('Payment Method'), 'option_url' => NULL, 'placeholder' => ts('- any -'))
+    // use contribution_payment_instrument_id instead of payment_instrument_id
+    // Contribution Edit form (pop-up on contribution/Contact(display Result as Contribution) open on search form),
+    // then payment method change action not working properly because of same html ID present two time on one page
+    $form->addSelect('contribution_payment_instrument_id',
+      array('entity' => 'contribution', 'field' => 'payment_instrument_id', 'multiple' => 'multiple', 'label' => ts('Payment Method'), 'option_url' => NULL, 'placeholder' => ts('- any -'))
     );
 
     $form->add('select',
index 9b94d9df5491b1a6bf9af9f2c7c1ba3d11778166..792bf2b0aef468a0e52badb3fb484381defa3c3f 100644 (file)
@@ -40,8 +40,8 @@
 <tr>
   <td>
     <div class="float-left">
-      <label>{$form.payment_instrument_id.label}</label> <br />
-      {$form.payment_instrument_id.html|crmAddClass:twenty}
+      <label>{$form.contribution_payment_instrument_id.label}</label> <br />
+      {$form.contribution_payment_instrument_id.html|crmAddClass:twenty}
     </div>
     <div class="float-left" id="contribution_check_number_wrapper">
       {$form.contribution_check_number.label} <br />