Skip to content

dev/core#2493 Add support for money laundry in getSubmittedValue #21555

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

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Sep 20, 2021

Overview

This ensures that any money fields retrieved by getSubmittedValue are
in a machine usable format.

https://lab.civicrm.org/dev/core/-/issues/2493#note_65321

Before

You might clean the money fields post submit but if you then access them using our increasingly-preferred helper you'll get the unclean version

After

The helper will launder your money

Technical Details

We've been switching to this function rather than 'passing around arrays'
but we need to ensure this function is returning clean money to
prevent regressions.

Comments

This relies on submittableMoneyFields being defined - which is fairly uniformly true in back office forms but needs work in front end forms

This ensures that any money fields retrieved by  are
in a machine usable format.

We've been switching to this function rather than 'passing around arrays'
but we need to ensure this function is returning clean money to
prevent regressions.
@civibot
Copy link

civibot bot commented Sep 20, 2021

(Standard links)

@civibot civibot bot added the master label Sep 20, 2021
@eileenmcnaughton eileenmcnaughton changed the title dev/core#2493 Add support for money fields to dev/core#2493 Add support for money fields to getSubmittedValue Sep 20, 2021
@eileenmcnaughton eileenmcnaughton changed the title dev/core#2493 Add support for money fields to getSubmittedValue dev/core#2493 Add support for money laundry in getSubmittedValue Sep 20, 2021
@eileenmcnaughton
Copy link
Contributor Author

@mattwire the original reason I put this PR up is 'on hiatus' - but my guess is that if we don't merge this then sooner or later we will by-pass our money laundry when using getSubmittedValue which always works on the raw submitted value

@mattwire mattwire merged commit c214450 into civicrm:master Sep 21, 2021
@eileenmcnaughton eileenmcnaughton deleted the money branch September 21, 2021 22:08
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.

2 participants