-
-
Notifications
You must be signed in to change notification settings - Fork 825
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 missing currency for event registration when configured via "quick config" #21966
Fix missing currency for event registration when configured via "quick config" #21966
Conversation
(Standard links)
|
@mattwire the 2nd and 3rd commits here look like they relate not sure about the 1st shouldn't that be in its own PR? |
167e1ee
to
3eb3e60
Compare
3eb3e60
to
d01db0d
Compare
Hi @seamuslee001 Thankyou I accidently pushed some local commits. Now cleaned up to just the one relevant commit. |
test this please |
1 similar comment
test this please |
@mattwire we (@kainuk, @BettyDolfing and I) are doing PR reviews and we tried to review this PR. We could reproduce this on dmaster.demo.civicrm.org however we could not login into the test sites. The admin section of civicrm suddenly logs us out. We are not sure whether this caused by something in your pr or whether the test site is broken. Can you have a look at the test site? And check whether the problem is adequately solved or whether this caused by something on the test site. If the latter is the case we should probably involve @bgm. |
Hi @jaapjansma the test site seems to be working ok for me |
@demeritcowboy, @eileenmcnaughton or @colemanw can one of you merge this PR? |
Thanks @jaapjansma |
Overview
This fixes a pretty obscure issue that can be triggered under the following conditions:
This triggers an AJAX call like this when you select a payment processor:
which causes on the PHP side currency to be set to the string "undefined":
which means if you subsequently try to use that value as the currency via an API3 call it fails because "currency" is treated as a magic value in API3 and gets validated against the list of currencies in CiviCRM and throws an exception.
Confused yet?
Before
When retrieving the currency in some obscure situations it all goes wrong.
After
It does not all go wrong anymore.
Technical Details
Described above.
Comments
This is obviously obscure enough that no-one noticed that the API3 exception was also returning invalid data!