Fix BackOffice Membership forms getPriceSetID() to be standard #29348
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
Fix BackOffice Membership forms getPriceSetID() to be standard
Before
We have been encouraging people to switch from accessing 'any property or method they can find' to ones designated as supported for external use. One of these is
getPriceSetID()
but on the back office membership form this function is non-standard and non-publicAfter
The methods are standard & public
Technical Details
The function is called both from a
postProcess()
and from aformRule()
function - we have hit a couple of gotchas sharing some between these which I have also addressed.We now recommend the use of
getSubmittedValue()
andgetSubmittedValues()
to retrieve the data the user has submitted. These functions do a bit of extra handing around money & also permit forms in multi-form flows to access the submitted values even through the values were submitted on a different form in the flow.However, the values aren't loaded into the QuickForm array until validate has been run - so up until that point we need to access the
submitValue()
function - the contents of which differ in that that they are basically raw post & not yet validated.But all that is a lot to know - a developer calling
getSubmittedValue()
wants to get the value the user submitted with an appropriate level of processing without having to do something different at different points of the submission. I did add an extrapurify
in there cos it seemed like good practice & I'd rather remove it later than add it later but I don't see it having any real impact in the way this is currently used.Comments