Skip to content
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

Field requires String, check for Array #141

Open
TomDeSmet opened this issue Nov 19, 2021 · 0 comments
Open

Field requires String, check for Array #141

TomDeSmet opened this issue Nov 19, 2021 · 0 comments

Comments

@TomDeSmet
Copy link

I'm adding data to a Jason field via AJAX by posting to a controller in another plugin. I noticed Jason Field expects a String as it does a JSON.decode() by default.

Maybe this could be altered and have an extra check for the Array type?
If I pass a JavaScript object in my fetch data like this: fields[jasonFieldHandle] the JasonField gets its data as an Array.
Now I need to have an extra JSON.stringify() in my JS code, which is not terrible, but it is weird from a developer point of view that I cannot pass valid JSON to a JSON field :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant