-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Fix JSON field for postgres when the value is a simple string #15752
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
Conversation
Codecov ReportBase: 59.25% // Head: 59.25% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #15752 +/- ##
=======================================
Coverage 59.25% 59.25%
=======================================
Files 1547 1547
Lines 39104 39104
Branches 7507 7507
=======================================
Hits 23172 23172
Misses 13638 13638
Partials 2294 2294
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Not sure this fixes much? Setting the type parser on the pg driver layer as it still is going to still try and parse it here: https://github.com/strapi/strapi/blob/main/packages/core/database/lib/fields/json.js The issue is that the field is being parsed via Strapi above so I would assume this would have the same issue but I haven't tested this branch. |
|
Oh is the issue that it's being parsed twice? if so then yes this would fix it. |
|
Just tested this and everything seems to be working, it will even "fix" databases that were broken before. Could we get this merged soon people are mentioning this in the discord and it has the possibility to brick admin panels for existing users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 Very good catch ! 🐛
Everything seems to be working, I don't get any error either :)
|
This pull request has been mentioned on Strapi Community Forum. There might be relevant details there: https://forum.strapi.io/t/no-validation-if-you-post-a-content-through-api/25747/4 |
What does it do?
Fix #15496
Why is it needed?
On Postgres, when the JSON value was a simple string, the value was parsed twice instead of once.
How to test it?
Related issue(s)/PR(s)