-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Remove zend json from theme #9262
Remove zend json from theme #9262
Conversation
…sing all argurments into consturctor
All this looks ok, but I was just wondering: seeing how the M2 JSON serializer is only a dumb wrapper over json decode/encode, how would we handle encoding/decoding errors? We'd have to use I'm saying this, because this PR removes a try/catch block that would've been otherwise useful. And said try/catch block was around a cookie read no less. Aka user input. You should never trust that. Imagine |
Yup @adragus-inviqa I was thinking about something similar to Zend https://github.com/zendframework/zend-json/blob/3426c66e689120a384a370df2cf35745f1b15b2c/src/Json.php#L230 or symfony https://github.com/symfony/serializer/blob/80e172d62cdac03df4a0fd8bcef8513bf9d2aa83/Encoder/JsonDecode.php#L80 and then process the exceptions. |
Well, yes, that's what I mean. But that also means that the behaviour of the serializer must change, breaking compatibility, because it doesn't throw at the moment. And since it's a BC break, they won't allow it. Your best option is a new Or maybe we can add a new method to the existing Serializer called |
Yeah, I think having another class specifically to deal with json throwing an exception is a bit of overkill. I will put together a PR for the serializer with the exception handling and see what the core Magento team say. |
@dmanners @adragus-inviqa thank you for raising the issue with Exceptions. This is known issue for us and Magento Core Team is looking for proper solution right now. |
@dmanners Thank you for the contribution |
…est-pr-exclude [Bengals] ACQE-7010: Add mftf third party test in pr exclude
Description
Since Zend Framework1 is EOL we should replace the usages. In this PR I replace the usage of Zend_Json in Magento Theme with the new serializer class. Part of the #9236 task.
Fixed Issues (if relevant)
Contribution checklist