Keyword

0 Error decoding JSON data: Syntax Error

More
6 months 20 hours ago - 6 months 5 hours 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: 6 months 5 hours ago by Mustafa Basaran.

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

More
2 months 1 week ago - 2 months 1 week 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: 2 months 1 week ago by Jack Hughes.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 month 3 weeks ago #168854 by Fotis
Fotis replied the 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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
1 month 3 days ago #169167 by Jack Hughes
Jack Hughes replied the 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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 month 2 days ago #169212 by Fotis
Fotis replied the 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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white