Use api to get price set metadata - Online Contribution Page #27902
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
Use api to get price set metadata - Online Contribution Page
Before
The
getCachedPriceSetDetail()
is not otherwise used to assign values to the form but is used to retrieve metadata for form usage. As we are starting to expose it more (viaBAO_Order->getPriceSetMetadata()
it feels like now is the right time to switch to apiv4 - so we can rely on typing. In general when we expose things for public access they use apiv4 format.After
Apiv4 used for retrieval, escaping added to smarty.
Technical Details
I filled all the text fields in civicrm_price_set, price_field & price_field value with script & fixed all the places that triggered my script - + a few more that didn't just for form.
Comments
There is also a recently merged regression fixed in here - @colemanw we should merge this before anyone hits it
Going through this exercise also reduces the risk of us accidentally introducing unescaped fields in future