51 Posts
alanski
7 years ago
Topic

This is a 'for your information" post.

A few people have reported seeing an error lie below in the front end of their sites.

Error decoding JSON data

This happened to me yesterday so i thought I'd post the cause and our  solution.

The symptom started with a search list that started returning a 404 page not found error. ON closer inspection there was a hidden server 500 error. We had several lists setup in Seblod all the same way and there were no differences with meta data as such. The issue as detailed here https://github.com/joomla/joomla-cms/issues/12460 strongly suggests that legacy json meta data might be in a format that the latest version of Joomla did not like.

I thought it could be 'dodgy' content and sure enough as soon as I unpublished one specific list item/article the 404 disappeared.

The problem: file upload plugin 

The title link of the file set in the file upload plugin field is set to store as json but the field length in the databse is only 255 characters and the clients was adding a title that was 267 characters long. The json was broken and this made the front end list display 404, and the backend for that specific article also showed the same error

Solution:

In the field manager i located the specific field and altered ts storage to be longer than 255 in the plugins admin settings. Simple as that.

Hope this saves some one else a few hours head scratching ;)

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
0
Level 1

Thank you for this information

7 Posts
st3f
7 years ago
1
Level 1

I had a quite similar problem. In my case a link type field had caused the JSON error.


What happend? A user had entered a fb url with '??' in it (https://www.facebook.com/events/287732691654544??ti=ia) what has resulted in a JSON error. The front page was blank, the article could not be opened anymore in the backend.

In DB this link was saved as '{"link":"https:\/\/www.facebook.com\/events\/287732691654544\/?context=create&previousaction=create&ref=5&page_id_source=430064984698633&sid_create=813739824&action_history=%5B%7B%22surface%22%3A%22create_dialog%22%2C%22mechanism%22%3A%22page_create_dialo'. It seems, the link field type has significant problems with '??' in a string.

After deleting this entry in DB all was fine again.

Solution (Seblod 3.10.0): Assign a URL-Validation to the link field in forms. After this, entering the link 'https://www.facebook.com/events/287732691654544??ti=ia' results in '{"link":"https:\/\/www.facebook.com\/events\/287732691654544??ti=ia"}'.

I hope this can help anyone saving some time. Maybe this can also help seblod programmers to fix this, so it works without the validation function assigned. Thanks for this great extension.

4229 Posts
Kadministrator
7 years ago
0
Level 2

Thnx for sharing a solution.

Get a VIP membership