Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix js error on choosing membership type #16058

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fixes a js error I'm seeing when changing membership type in a back office form. I have 2 processors that support recurring configured

Before

Js error in console

Screen Shot 2019-12-09 at 11 04 01 PM

After

Error gone

Technical Details

I'm seeing a js error when I select a membership type in the back end form. It seems I have recurProcessors assigned
& they have an onChange that calls
buildAutoRenew - which is non existant if the action is not 2. It seems to me that the code is simplest when functions
can be relied on to exist and aree called conditionally - this makes that change, also ensuring 'something' is
assigned for recurProcessors to prevent the error when it's not defined that probably let to the fn being encased in an if

I can't spot any obvious regression cause & perhaps there is something in my config but this might be a regression

Comments

No noted impacts other than the error in console

I'm seeing a js error when I select a membership type in the back end form. It seems I have recurProcessors assigned
& they have an onChange that calls
buildAutoRenew - which is non existant if the action is not 2. It seems to me that the code is simplest when functions
can be relied on to exist and aree called conditionally - this makes that change, also ensuring 'something' is
assigned for recurProcessors to prevent the error when it's not defined that probably let to the fn being encased in an if

I can't spot any obvious regression cause & perhaps there is something in my config but this might be a regression
@civibot
Copy link

civibot bot commented Dec 9, 2019

(Standard links)

@mattwire
Copy link
Contributor

mattwire commented Dec 9, 2019

Noting that the autorenew code on the js side is a minefield and really needs cleaning up. This PR simplifies things a bit so I am in favour.

@seamuslee001
Copy link
Contributor

Tested this and confirmed it works as expected and the JS error is gone merging

@seamuslee001 seamuslee001 merged commit 134fdbb into civicrm:master Dec 9, 2019
@eileenmcnaughton eileenmcnaughton deleted the mem_js branch December 9, 2019 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants