- Issue created by @ctrladel
- ๐บ๐ธUnited States sharkbaitdc
Here's the error that I found when there's an empty object
- ๐ง๐ทBrazil carolpettirossi Campinas - SP
@sharkbaitdc, can you please share the scenario where you found the error above just so I try to reproduce and see if the patch fixes it?
Thanks :)
- ๐บ๐ธUnited States ctrladel North Carolina, USA
After talking with e0ipso it seems like documenting the way to correctly type empty values is the path forward. There are two main cases that we are likely to encounter
- Array found expecting Object
- Null found expecting Anything(string, number, array, etc)
In both cases the solution is to use the
|default()
filter to set the correct empty value.Another thought was to try and capture this type of error in the validator and in the error message link to the fix on drupal.org.
- last update
over 1 year ago Custom Commands Failed - @ctrladel opened merge request.
- Status changed to Needs review
over 1 year ago 5:02pm 8 June 2023 - last update
over 1 year ago Build Successful - ๐บ๐ธUnited States ctrladel North Carolina, USA
Opened a MR that does two things
- Enables fuzzy type casting for arrays and objects during validation using Constraint::CHECK_MODE_TYPE_CAST from the validation library https://github.com/justinrainbow/json-schema
- Check the error messages for a NULL found error and append additional context that points people to the most likely problem/solution which is that the empty data value and the populated data value have different types. I wasn't able to find an easy way to check the schema against the props which is why I checked the error message text instead of a more thorough approach. - last update
over 1 year ago 29,436 pass - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,437 pass - last update
over 1 year ago 29,437 pass - Status changed to Needs work
over 1 year ago 10:09pm 8 June 2023 - ๐บ๐ธUnited States smustgrave
Can the issue summary be updated with steps to reproduce and the proposed solution please.
- Status changed to Needs review
over 1 year ago 8:21pm 11 June 2023 - last update
over 1 year ago 29,419 pass, 1 fail - e0ipso Can Picafort
Suggesting credit to @sarahjean for the report in ๐ Unhelpful error message with SDC when a optional variable is missing Closed: duplicate .
The last submitted patch, 8: 3365480--8--test-only.patch, failed testing. View results โ
- Status changed to RTBC
over 1 year ago 8:10pm 12 June 2023 - ๐บ๐ธUnited States smustgrave
Hiding the tests-only patch so the review bot doesn't send back to NW.
Issue summary also looks good! Thanks for that.
Reviewing MR 4141 and following the steps of the issue summary can confirm the issue and that it has been fixed.
45:09 41:29 Running- ๐บ๐ธUnited States eojthebrave Minneapolis, MN
Fix typo in issue title.
- ๐บ๐ธUnited States sharkbaitdc
I was converting pager into a sdc and one of the variables passed is the ellipse object which can be empty depending on the page youโre on.
-
lauriii โ
committed 80174a6c on 11.x
Issue #3365480 by ctrlADel, e0ipso, sharkbaitdc, smustgrave, sarahjean,...
-
lauriii โ
committed 80174a6c on 11.x
-
lauriii โ
committed 046cefe4 on 10.1.x
Issue #3365480 by ctrlADel, e0ipso, sharkbaitdc, smustgrave, sarahjean,...
-
lauriii โ
committed 046cefe4 on 10.1.x
- Status changed to Fixed
over 1 year ago 4:52pm 13 June 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
5 months ago 5:15pm 17 July 2024 - ๐ซ๐ทFrance andypost
There's follow-up to improve error message, it missing component name at least ๐ Unhelpful PHP error with NULL type property Needs review