-
Notifications
You must be signed in to change notification settings - Fork 11
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 not normalized on action request #108
Comments
#73 ..? |
#73 seems to be the cause of this bug indeed. Turns out |
I'd have to look into figuring out test cases for both instances. Open to PR's if you have the environments set up (only asking since you were on both issues). I agree, looks like #73 was the wrong bandaid. |
Thank you. I'm not really familiar with Crafts |
Any updates on this matter? This bug seem to be coming back every once in a while in one of our projects. |
This keeps biting us too, any progress? |
@philipzaengle I really need to know exactly what cases folks are running into this error so I can tailor the response for each. @jerome2710 was your workaround working (at least in your one project) for all known cases? |
@chasegiunta @philipzaengle I have not narrowed it down to specific cases / errors, but instead just wrote a helper-function to retrieve the JSON-data: public static function getData(Element $element): array
{
$data = $element->json ?? [];
if (!empty($data) && is_string($data)) {
$data = json_decode($data, true) ?? [];
}
return $data;
} So looking up the |
So .. I've been running into this issue and another issue that I think is related to #73 .. and I think the fix is relatively simple. On this line, changing:
to:
Should help with not trying to normalize input that's already formatted properly. Which should make it easier to save data to as Jason field programmatically without experiencing errors. |
Has the author abandoned this plugin? Would be nice to have an update on this or some communication at a minimum. |
I just unfortunately don't use Craft for my day job, and my one volunteer project with Craft does not use this plugin. I just haven't been able to dedicate the time to test all the use-cases, because apparently there are several scenarios where one change could break another, so I'm a bit fearful to make any changes. I might hand this plugin over to someone else, but in the mean-time, forking and making the changes necessary for your use-case might be the way to go. |
Thanks, @chasegiunta -- appreciate your message! |
Hi!
May I ask why the field content is not normalized when the request is an action request (https://github.com/chasegiunta/craft-jason/blob/master/src/fields/JasonField.php#L126)?
We are displaying Jason contents on a page which also includes a MailChimp subscribe form. After posting the subscribe form and returning to the page, the Jason content is not decoded and is causing errors now.
The text was updated successfully, but these errors were encountered: