Keyword

0 Error decoding JSON data: Syntax Error

More
3 months 4 weeks ago - 3 months 4 weeks ago #167634 by Mustafa Basaran
Mustafa Basaran replied the 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
https://www.itprisma.de
E-Mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Attachments:
Last Edit: 3 months 4 weeks ago by Mustafa Basaran.

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

More
1 week 5 days ago - 1 week 5 days ago #168664 by Jack Hughes
Jack Hughes replied the 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: 1 week 5 days ago by Jack Hughes.

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

Moderators: william white