- Posts: 13
COMMUNITY FORUM
0 Error decoding JSON data: Syntax Error
- Zoe
-
Topic Author
- Offline
- New Member
I have recently upgraded Joomla! to 3.6.4 and now I get the above error (0 Error decoding JSON data: Syntax Error) on a number of K2 items while on others I don't.
I have tried resetting the parameters as discussed on issues.joomla.org/tracker/joomla-cms/12460 - I have removed the Editor and JB Library is not installed. I still get the same error.
0 Error decoding JSON data: Syntax error
Call stack
# Function Location
1 JApplicationCms->execute() /[path]/administrator/index.php:51
2 JApplicationAdministrator->doExecute() /[path]/libraries/cms/application/cms.php:261
3 JApplicationAdministrator->dispatch() /[path]/libraries/cms/application/administrator.php:152
4 JComponentHelper::renderComponent() /[path]/libraries/cms/application/administrator.php:98
5 JComponentHelper::executeComponent() /[path]/libraries/cms/component/helper.php:380
6 require_once() /[path]l/libraries/cms/component/helper.php:405
7 JControllerLegacy->execute() /[path]/administrator/components/com_k2/k2.php:147
8 K2ControllerItem->display() /[path]/libraries/legacy/controller/legacy.php:702
9 K2Controller->display() /[path]/administrator/components/com_k2/controllers/item.php:21
10 JControllerLegacy->display() /[path]/administrator/components/com_k2/controllers/controller.php:20
11 K2ViewItem->display() /[path]/libraries/legacy/controller/legacy.php:664
12 Joomla\Registry\Registry->__construct() /[path]administrator/components/com_k2/views/item/view.html.php:466
13 Joomla\Registry\Registry->loadString() /[path]/libraries/vendor/joomla/registry/src/Registry.php:72
14 Joomla\Registry\Format\Json->stringToObject() /[path]/libraries/vendor/joomla/registry/src/Registry.php:366
Please help.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
This is a core Joomla! issue, a lot of sources for this error.
There are several solutions posted online, I think one from Joomlashack was the most thorough.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Zoe
-
Topic Author
- Offline
- New Member
- Posts: 13
Thanks for the link to the JoomlaShack topic, I checked it. update [prefix]_modules set params="" WHERE params = "{"\"\"}";
is the first thing I did. I got a return of 0 rows updated.
I saw further down in the Github conversation that it was argued this is not a Joomla core issue and it is an extensions issue to do with the extensions not being able to handle this higher level of error handling, if I've understood it correctly.
I have also implemented the #116713 solution and defined the following in the top of my index.php file:
unset($this->_scripts[JURI::root(true).'/components/com_k2/js/k2.js?v2.7.1&sitepath='.JURI::root(true).'/']);
And I'm still getting the error. I thought disabling the javascript would resolve the JSON error? Am I wrong?
I have currently resorted to deleting the old K2 items and replacing them with new ones (after copying the content directly out from the SQL) this works but it is far from an ideal solution.
Any ideas?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
The item's params are stored in JSON format.
If removing an item solves the issue, then you might have located the culprit.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
I've found this issue while I'm editing some K2 items, after upgrading to Joomla 3.6.4
After some debugging on my personal website, I fixed this issue by hacking the file /administrator/components/com_k2/views/item/view.html.php
I replaced this statement:
FilterOutput::objectHTMLSafe($item, ENT_QUOTES, array(
'video',
'params',
'plugins'
));
With this one:
FilterOutput::objectHTMLSafe($item, ENT_QUOTES, array(
'video',
'params',
'plugins',
'metadata'
));
You can give it a try, may be it fix your issue.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- smarterweb
-
- Offline
- New Member
- Posts: 3
A solution is to clear the column "metadata" in k2 table "k2_items" here's the sql query:
UPDATE `tableprefix_k2_items` SET `metadata` = ''
NOTE: You will of course loose your metadata if there was any.
Please Log in or Create an account to join the conversation.
- Zoe
-
Topic Author
- Offline
- New Member
- Posts: 13
Where Joomla articles had been imported, the metadata was showing:
{"robots":"","author":"","rights":"","xreference":....
Where I had recreated articles in K2 after the upgrade, the same metadata was showing:
robots=
author=
Now that I have cleared that field, I can now access the old articles!
Thank you smarterweb!
Please Log in or Create an account to join the conversation.
- Zoe
-
Topic Author
- Offline
- New Member
- Posts: 13
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Care to make a PR?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
Yes of course, just wanted to have some more tests from others before the PR.
Can you help in this test?
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- robert went
-
- Offline
- New Member
- Posts: 5
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Thanks.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- burnyourears
-
- Offline
- Senior Member
- Posts: 66
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I'd love to help.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ami Ella
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Duane Mitchell
-
- Offline
- New Member
- Posts: 1
If I have {"robots":"","author":"","rights":"","xreference":""} then it doesn't work.
If I have the following it does work.
robots=
author=
So first I deleted the nonworking data and left it blank. That works. But then I replaced it with the working data and that seems to work.
I'm going to fix these on an as needed basis and maybe a more robust fix will arrive.
Please Log in or Create an account to join the conversation.
- Jonathan Josué Virgen Jiménez
-
- Offline
- New Member
- Posts: 2
http://imgur.com/a/Gnq24
http://imgur.com/a/12Hg6
Please Log in or Create an account to join the conversation.
- Zoe
-
Topic Author
- Offline
- New Member
- Posts: 13
I'm not an expert but your error messages are not the 0 Error decoding JSON data: Syntax Error.
They show that it is the JCE Editor component which is having problems: "...com_jce\models\editor.php
Start by checking your Site > Global Configuration > Default editor.
And please start a new topic if you have not been able to resolve it from there..
Best wishes.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
These errors are coming from the JCE editor not K2.
Disable error reporting to get rid of them.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.