From: Patrick Lam Date: Tue, 16 Jan 2024 11:03:44 +0000 (+1300) Subject: When auto-renew option is available, show the checkbox immediately instead of upon... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0358661ed5c631527249d73b94bbc7ba50707582;p=civicrm-core.git When auto-renew option is available, show the checkbox immediately instead of upon clicking the price. memTypeId was previously "undefined" after trying to read attribute "membership-type". The DOM shows an attribute "data-membership-type-id" and this patch modifies the attribute read to "data-membership-type-id", which is also consistent with the variable name in the code. --- diff --git a/templates/CRM/Contribute/Form/Contribution/MainMembershipBlock.tpl b/templates/CRM/Contribute/Form/Contribution/MainMembershipBlock.tpl index c4aca65220..ecad3a4821 100644 --- a/templates/CRM/Contribute/Form/Contribution/MainMembershipBlock.tpl +++ b/templates/CRM/Contribute/Form/Contribution/MainMembershipBlock.tpl @@ -134,7 +134,7 @@ var priceSetName = "price_"+{/literal}'{$membershipFieldID}'{literal}; var considerUserInput = {/literal}'{$takeUserSubmittedAutoRenew}'{literal}; if ( memTypeId ) considerUserInput = false; - if ( !memTypeId ) memTypeId = cj('input:radio[name='+priceSetName+']:checked').attr('membership-type'); + if ( !memTypeId ) memTypeId = cj('input:radio[name='+priceSetName+']:checked').data('membership-type-id'); //does this page has only one membership type. var renewOptions = {/literal}{$autoRenewMembershipTypeOptions}{literal};