Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.0
-
Fix Version/s: 4.2.0
-
Component/s: CiviContribute, CiviMember
-
Labels:None
Description
Online contribution page with membership block and "required" auto-renew membership types allows user to uncheck the "Please renew my membership automatically" checkbox and throws a Javascript error because showHideAutoRenew() function is being called but is NOT included in the page.
Error: ReferenceError: showHideAutoRenew is not defined
Source File: http://civicrm42/civicrm/contribute/transact?reset=1&id=5
I've created a page which replicates the problem on public demo at:
http://civicrm42/civicrm/contribute/transact?reset=1&id=5
To recreate:
- set up payment processor that supports recurring (PP Std for example)
- set up 2 membership types with auto-renew required
- create contrib page w/ no contribution section and enable the 2 auto-renew membership types with auto-renew "required" - make one membership type the default
- go to contrib page and click other membership type - you'll get jScript error
- notice that you can uncheck the auto_renew checkbox
Looks like the problem is (partially) in templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl. This template has several references to $is_quick_config. However when I use smartyDebug on this online contrib page - there is no such variable. There IS $quickConfig which is set to 1 as expected - but that var is not used. Since $is_quick_config is not present, the section of the tpl starting at line 110 is NOT included.
{elseif $membershipBlock AND !$is_quick_config}... and this is the section that has the required js function.
I tried just replacing is_quick_config w/ quickConfig - but that messes up other things, so the root of the problem is a bit deeper