Keyword

0 Error decoding JSON data: Syntax Error

More
6 years 7 months ago - 6 years 7 months ago #167634 by Mustafa Basaran
Replied by Mustafa Basaran on topic 0 Error decoding JSON data: Syntax Error
Solution for Joomla above 3.8.x:

The problem in this case is the "registry.php" File.
Path: libraries/vendor/joomla/registry/src/Registry.php

The attached "zip"-File has 2 files in it.
a.) original "registry.php" File, that causes the failure on K2 items that are imported. That you have in your Joomla-installation.
b.) an the modified "registry.php" file, that does not cause the problem.

Here The Solution.

File Attachment:

File Name: Registry__...4-20.zip
File Size:8 KB


- open the zip-File in attachement with 2 Files: with the original and the temporarily registry.php files.
- replace the original registry.php with the temporarily registry file
- then open all the K2-Items that causes this problem, and Save (or Save and close)
- important!! at last, replace the temporarily file with the original again.
---> because while you replaced the original with the temp-file, in front-page will be an error in this K2-Item.
But with the original file again, this problem wont exist.

hope i could help.

Mustafa Basaran
www.itprisma.de
E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Attachments:
Last edit: 6 years 7 months ago by Mustafa Basaran.

Please Log in or Create an account to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #168664 by Jack Hughes
Replied by Jack Hughes on topic 0 Error decoding JSON data: Syntax Error
For those having trouble with the SQL that Alan posted, here is SQL I ran that successfully replaced the bad metadata json.

I first ran this to check if my search target was correct
SELECT * FROM `tablePREFIX_k2_items` WHERE `metadata` = '{"robots":"","author":""}'

Then I ran:

UPDATE `tablePREFIX_k2_items` SET `metadata` = replace(metadata, '{"robots":"","author":""}', 'robots=author=')

Don't forget to use your own tablePREFIX

This did the trick
Last edit: 6 years 3 months ago by Jack Hughes.

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #168854 by JoomlaWorks
Replied by JoomlaWorks on topic 0 Error decoding JSON data: Syntax Error
Is this still an issue with Joomla 3.8.12?

If so, we may need to release a fixer tool for this...

I'd like your feedback please.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #169167 by Jack Hughes
Replied by Jack Hughes on topic 0 Error decoding JSON data: Syntax Error
Hey Fotis,

I can confirm that this is happening in Joomla 3.8.12 with K2 2.8.0

I was working with website where Joomla items were imported into K2 back in 2009. I got the "0 Error decoding JSON data: Syntax error" when I tried to edit it.

Please Log in or Create an account to join the conversation.

More
6 years 2 months ago #169212 by JoomlaWorks
Replied by JoomlaWorks on topic 0 Error decoding JSON data: Syntax Error
Thanks, it's a bug alright as the data is store as a string and not as JSON object. Noted to fix for 2.9.0 or 2.9.1.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum