CRM-16966 fix - backoffice buildRecur script loads processor incorrectly (sometimes)
authormonishdeb <monish.deb@webaccessglobal.com>
Sat, 29 Aug 2015 20:48:24 +0000 (02:18 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Sat, 29 Aug 2015 20:48:24 +0000 (02:18 +0530)
https://issues.civicrm.org/jira/browse/CRM-16966

templates/CRM/Contribute/Form/AdditionalInfo/Payment.tpl

index a1f4d4f99f43c0095cc8cf48bac810cd7016e206..a6810dd89aa5127b5fe0782d4ed240304e2473b5 100644 (file)
     }
 
     function buildRecurBlock( processorId ) {
-
       if ( !processorId ) processorId = cj( "#payment_processor_id" ).val( );
       var recurPaymentProIds = {/literal}'{$recurringPaymentProcessorIds}'{literal};
-      var funName = 'hide';
-      if ( recurPaymentProIds.indexOf( processorId ) != -1 ) funName = 'show';
+      var funName = ( cj.inArray(processorId, recurPaymentProIds.split(',')) > -1 ) ? 'show' : 'hide';
 
       var priceSet = cj("#price_set_id");
       if ( priceSet && priceSet.val( ) ) {