Fix js error on choosing membership type #16058
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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