I'm trying to switch a field (property-price) from a number field to a single-line field. The client wanted more flexibility in what the price looks like. I've switched the field successfully to the single-line type, however, when I type something that is non-numerical, the content is truncated. For example, if I put $13,000,000, only the value "13" is stored.
What I've tried so far:
-Manually putting in $13,000,000 in the post meta field: Only "13" is shown in the post editor and the view
-Manually putting 13,000,000 (without the dollar sign): Only "13" is shown in the post editor and the view
-Manually putting 13000000 (No non-numerical ): Shows the correct value in the post editor and the view
-Remove the field completely and recreate a new field with the same name: No change in the behavior. Values are truncated after non-numerical value
-Switched it to a multi line: Same behavior as single-line, truncation after non-numerical value.
None of my other fields are acting the same way. I can put $13,000,000 in other single-line fields and the value appears to work as expected.
Please let me know if I can provide any more information on this issue. Thank you.
I've just tested the same on a local site and found that even after switching the field type from numeric to single line the validation (for a number) was still being applied.
I thought if I switched it back to numeric I could edit the field to remove the validation, but it seems like it is compulsory for a numeric field to have number validation, so I don't have a workaround right now.
I'm escalating this to my second tier so that they can check for a possible workaround before escalating to the developers.
This has been escalated to the devs to fix, but my colleague found that you can try editing this custom field (at Toolset > Custom Fields) and checking the validation (required), saving, then un-checking the validation and saving again, which should reset the field validation configuration.
I tried that with the affected fields and the value was truncated after the first non-numerical character. Please let me know if there's anything else I can try.
I think I'll need a copy of your site, then, as the symptoms are slightly different than on my test site and what my colleague found, so there may be something else at play here.
Can you create a copy and share a link to the archives on dropbox or similar here, thanks.
I can confirm the issue on your site and I've done testing myself to try and get past the problem but cannot, so I'm escalating this so that my colleagues in second tier can do some deeper debugging.