-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
number widget saving as string with valueType int #2007
Comments
Seeing the same thing here. This causes big problems with Gatsby as it cannot infer type if there are multiple types used for the same field. I had added numbers to the fields, then someone edited a file using the CMS and this resulted in the number being saved as string, causing Gatsby to ignore the field entirely and breaking our build. If anyone needs a short-term solution to this, you will need to coerce any fields that use the number widget to numbers and write them to a field, then use that field. Gatsby will still complain, but at least you can get moving. |
I cannot reproduce this issue, @erquhart can you confirm from your end? |
I'm on holiday away from my machine, but my issue is the same as @zanona's. Root level of a collection but for me it was a yaml front matter field in a markdown file. Before save:
After save:
|
@barthc Not seeing this issue any more with 2.4.1 |
That's awesome - @zanona can you confirm this is resolved for you in 2.4.1? |
Hi, @erquhart. I'm afraid not, unfortunately :( |
@zanona You don't have a |
I'm afraid nothing changes, @Undistraction. |
Is this still an active issue? @zanona |
Hi, @alishamohanty |
You're Welcome @zanona :) |
I suppose this ticket can be closed. |
This is still an issue if the value is removed. If the field is not required and you remove a previously set number you should get |
We really need to start having widgets handle setting their own empty values rather than guessing from the core. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The empty value issue is covered under #2848. |
Tracking in #995 instead. |
Describe the bug
I have a field set to the number widget where it's taking an initially set integer value but saving it as a string.
To Reproduce
config.yml
document.yml
After changing the product price to
265
through Netlify CMS, the updated document looks like:Expected behavior
Save output as integer
Applicable Versions:
https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js
The text was updated successfully, but these errors were encountered: