Keyword

0 Error decoding JSON data: Syntax Error

More
8 years 3 months ago #158910 by Zoe
Hello,

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #158917 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
Hello,

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.

More
8 years 3 months ago - 8 years 3 months ago #158929 by Zoe
Hello Krikor,

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?
Last edit: 8 years 3 months ago by Zoe. Reason: updated k2.js version in line of code

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #158930 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
The unsetting of a JS script is a frontend issue, it won't affect any aspect of data stored in the db.

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
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago #159082 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic 0 Error decoding JSON data: Syntax Error
Hello All,

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.

More
8 years 3 months ago #159091 by smarterweb
Replied by smarterweb on topic 0 Error decoding JSON data: Syntax Error
we had the same issue, but only after importing Joomla articles into K2. Seems there is leftover metadata that creates the problem.
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.

More
8 years 3 months ago - 8 years 3 months ago #159096 by Zoe
I had kept a few non-working articles to test a fix and yours worked.
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!
Last edit: 8 years 3 months ago by Zoe.

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

More
8 years 3 months ago #159097 by Zoe
Hello Mohamed, I went looking for the line you quoted and couldn't find it but it was definitely a problem with the metadata. Thanks!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #159101 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
Hello Mohammed,

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
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 3 months ago - 8 years 3 months ago #159103 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic 0 Error decoding JSON data: Syntax Error
Hello Krikor,

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
Last edit: 8 years 3 months ago by Mohamed Abdelaziz.

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

More
8 years 3 months ago #159135 by robert went
Replied by robert went on topic 0 Error decoding JSON data: Syntax Error
I created a script to check for potential issues. You can find it here: github.com/robwent/joomla-json-db-check

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #159139 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
Nice one Robert!!
Thanks.

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

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

More
8 years 3 months ago #159161 by burnyourears
Replied by burnyourears on topic 0 Error decoding JSON data: Syntax Error
Thank you very much @smarterweb – it was the metadata, just had the same problem and could solve it.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #159204 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
@Mohammed, what do need mate?
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.

More
8 years 3 months ago #159343 by Ami Ella
Replied by Ami Ella on topic 0 Error decoding JSON data: Syntax Error
I head the same problem. deleting "{"robots":"","author":"","rights":"","xreference":""}" from the DB solved it. Thanks...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 3 months ago #159359 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
Nice to hear that :)

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

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

More
8 years 2 months ago #159407 by Duane Mitchell
Replied by Duane Mitchell on topic 0 Error decoding JSON data: Syntax Error
Same issue here. Some articles throw the error, some don't. The k2_items metadata seems to be the culprit. I have one of 2 things in my metadata.

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
  • Jonathan Josué Virgen Jiménez's Avatar
  • Offline
  • New Member
More
8 years 2 months ago - 8 years 2 months ago #159436 by Jonathan Josué Virgen Jiménez
Replied by Jonathan Josué Virgen Jiménez on topic 0 Error decoding JSON data: Syntax Error
Hello, I have an issue like all of this topic, but I can access to K2 items or category (screenshot attached), I check the metadata items erasing or replacing with the correct form, I check one by one the params content with a JSON Validator and all its OK and still with the same issue. If I open a item from K2 Stats Admin I can show a line error. (screenshot attached). Can some one help me?

http://imgur.com/a/Gnq24

http://imgur.com/a/12Hg6
Last edit: 8 years 2 months ago by Jonathan Josué Virgen Jiménez. Reason: Suscribing

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

More
8 years 2 months ago #159438 by Zoe
Hello Jimenez,

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 2 months ago #159454 by Krikor Boghossian
Replied by Krikor Boghossian on topic 0 Error decoding JSON data: Syntax Error
Hello,
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.


Powered by Kunena Forum