-
Notifications
You must be signed in to change notification settings - Fork 114
Json decoding error #29
Comments
I have seen "Decoding failed, syntax error" exceptions a number of times since upgrading to PHP 7. The common factor - but might be a bizarre coincidence - is that in each case the affected user was using Safari on an iOS device (iPad usually). I've been unable to reproduce it myself, but have seen it consistently happen for some people. |
This is exactly the error I'm talking about. I am also not able to reproduce the error, I only get the error emails sent from our server. I noticed that it happens in about 90% of the cases during checkout, when clicking the submit order button, and 10% in the customer/account route, probably when saving an address. |
I'm glad you've flagged it because I thought it was something broken with my install. I've had no joy at all trying to track it down so your links could prove useful. This is an example of one of the errors I would see in the var/report folder - the user is seeing a 500 error page at this point, which since it's happening during checkout is not very reassuring...
|
I can confirm that I get the same error message/trace. |
I've added a commit and pull request that may or may not fix this issue. (One for each branch, but they're both the same) Will the people that are having this issue implement the change on your installations and see if it fixes the issue? I don't have the resources to be able to test it. Please note, this is an untested fix, and no guarantees or warranties are offered. Use at your own risk. |
Thanks Benjam, I will test the fix and report back in a week if the error went away. |
Was wondering if the fix is working. Thanks! |
It has been one week since I implemented the fix and the error has not appeared again. |
Tested and works, haven't had any problems since I've implemented it. Please merge @icurdinj :) |
Nice. How does one go about incorporating this fix if I'm running the standard Inchoo_PHP7 branch? Or should I just wait for @icurdinj to commit it? |
I created my own small extension for it, but you can also wait for @icurdinj .. I hope he'll merge it today/tomorrow. |
Patch merged. Big thanks to everyone who contributed in any way. |
I just updated to this using "modman update-all", it pulled the changes but now my site crashes with the following error:
EDIT: It looks as if there is no symlink back to ~/.modman/Inchoo_PHP7/app/code/local/Inchoo/PHP7/Helper created - should this happen automatically with the update? |
Seems like no one updated modman file with new files... I'll fix it now... |
Should be fixed in master branch now. Please try it out. |
Worked, thanks. A minor point but the update process moans that the Not a big deal and moving forwards that's clearly the best way to make things easier for future updates, but you have to use |
Yep, a slight pain now, but should prevent further such problems... |
Hi! But still the problem is not resolved. Please help me out as it's crucial for our business. Thanks! |
@praveen-tyagi stack trace is needed to know what is going on. Your project may be experiencing this error from non-core code which is decoding without using the Magento JSON decoder, if that is the case this module will not fix the issue. |
Thanks for the reply! but how I can know about that :
Pls help me out as it's going to be very crucial for me.
With Thanks!
…On Fri, Aug 10, 2018 at 12:19 PM, Kostadin A. ***@***.***> wrote:
@praveen-tyagi <https://github.com/praveen-tyagi> stack trace is needed
to know what is going on. Your project may be experiencing this error from
non-core code which is decoding without using the Magento JSON decoder, if
that is the case this module will not fix the issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWfPQThfg3r_gP6xWpMwFfDWiMknsWsKks5uPS0NgaJpZM4ICEh_>
.
|
PHP 7 throws an exception when trying to decode an empty json string, this can result in errors in checkout and customer panel, when trying to save data, see here:
stackoverflow post and magento.stackexchange post.
Apparently it happens in Mage_Persistent_Model_Session in _beforeSave() $this->getData() is empty so $info is empty and decoding fails (taken from stackexchange post). A solution would be to pass "{}" instead of "".
The text was updated successfully, but these errors were encountered: