-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/financial#171 - Trigger an error if non-numeric value passed to Money::format() #19938
Conversation
(Standard links)
|
|
@demeritcowboy more than I expected! |
I was looking at some. I think several might be bad smarty that somehow ends up calling crmMoney indirectly but the error gets swallowed up somewhere so it's never come up before. |
@demeritcowboy I took a look at that first one & it's pretty dodgey - what gets passed in is '100, 100' I think this is OK #19940 (I hope we don't have to go through every single one & several are failing on the same thing....) |
Also #19941 |
test this please |
I just gave this a very optimistic MOP |
They didn't just melt away Test Result (20 failures / +20) |
The ones that trigger civicase errors are technically correct I think, I just have no idea why this PR causes that. In secure mode, smarty should reject loading a tpl that isn't under templates or an authorized directory. The fact that the case sample tpl lives under CRM is a weird oddity, cuz civicase. I'm really curious though how this PR triggers those errors. |
Oh I think I know. Smarty is a static singleton. Calling fetch('string:...') sets secure mode. When it fails, secure mode never gets reset, so the other tests start running under secure mode. |
ohhhh - go super-sleuth |
Test failure seems related https://test.civicrm.org/job/CiviCRM-Core-PR/40101/ |
jenkins retest this please |
Well done all here |
Oh wow - it passed! |
Yay! |
Overview
https://lab.civicrm.org/dev/financial/-/issues/171#note_56673
To trigger this you can do something like put
{'aaa'|crmMoney}
in any template and then visit that page. You should see an error if you have on-screen errors turned on (drupal).Before
Confusing warning about missing INTL when non-numeric values are passed to Money::format()
After
User deprecated function: Formatting non-numeric values is no longer supported: <the offending value>
Technical Details
It was being intercepted before because it made tests fail on php 7.4 prematurely. No longer a need to do this so this will also see if any more tests fail now.
Comments