Fix build custom data twice on edit forms
authorMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Mon, 7 Jan 2019 16:29:06 +0000 (16:29 +0000)
committerMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Mon, 7 Jan 2019 17:57:15 +0000 (17:57 +0000)
CRM/Member/Form/Membership.php
templates/CRM/common/customDataBlock.tpl

index 91ed3b1274019e77385fd735f7210ae8904d2bee..4a4bcbd42fcb35dd249497436586b7e2cf3e0c41 100644 (file)
@@ -581,7 +581,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
     );
 
     if (!empty($this->_recurPaymentProcessors)) {
-      $memTypeJs['onChange'] = "" . $memTypeJs['onChange'] . "buildAutoRenew(this.value, null, '{$this->_mode}');";
+      $memTypeJs['onChange'] = "" . $memTypeJs['onChange'] . " buildAutoRenew(this.value, null, '{$this->_mode}');";
     }
 
     $this->add('text', 'max_related', ts('Max related'),
index 21adcb8867b05b43a51a33ad59e925e9ca9ca2b4..d98b4a996af720665eeeb5c4a21fbcf2dbd006b2 100644 (file)
@@ -6,9 +6,10 @@
   <script type="text/javascript">
     CRM.$(function($) {
       {/literal}
-      CRM.buildCustomData( '{$customDataType}' );
       {if $customDataSubType}
-      CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
+        CRM.buildCustomData('{$customDataType}', {$customDataSubType});
+      {else}
+        CRM.buildCustomData('{$customDataType}');
       {/if}
       {literal}
     });