- Posts: 5
COMMUNITY FORUM
0 Error decoding JSON data: Syntax Error
- robert went
-
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Thanks.
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.
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
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.
Please Log in or Create an account to join the conversation.
- Jason Landau
-
- Offline
- New Member
- Posts: 10
Thank you, This resolved the issue for me as well. Joomla 3.6.5 / K2 v2.6.9Mohamed Abdelaziz wrote: 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.
Please Log in or Create an account to join the conversation.
- Concerto Designs Inc.
-
- Offline
- Junior Member
- Posts: 29
goo.gl/vmaf80
-Alan
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Aashir Khan
-
- Offline
- New Member
- Posts: 1
SELECT * FROM `jml3_k2_items` SET `metadata` = 'robots=author=' WHERE `metadata` = '{"robots":"","author":"","rights":"","xreference":""}'
but I got the following message:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET `metadata` = 'robots=author=' WHERE `metadata` = '{"robots":"","author":"","' at line 1
I tried this query as suggested by someone else on the first page of this forum:
UPDATE `jml3_k2_items` SET `metadata` = ''
This one went through but in the SQL query page, but in Joomla in K2, the error message when opening any item didn't dissapear.
Finally, I tried changing the view.html.php file as suggested by Mohamed Abdelaziz on the first page, and that did work in removing the error message in K2 and allowing me to see my items. However, I fear that perhaps I might not be able to use metadata in my K2 items anymore by carrying out his solution. So I was wondering Concerto Designs LLC if you know why I'm getting this error message in the SQL query page when running your query with the correct database prefix?
Thanks!
Please Log in or Create an account to join the conversation.
- Geo Ce
-
- Offline
- New Member
- Posts: 1
Step 1: Edit "(JOOMLA_PATH)/libraries/vendor/joomla/registry/src/Registry.php"
Step 2:
In line 366 replace:
$obj = $handler->stringToObject($data, $options);
to
$obj_count = json_decode($data);
if(count($obj_count) > 0) {
$obj = $handler->stringToObject($data, $options);
} else {
$obj = $obj_count;
}
And everything is back to normal!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Rega
-
- Offline
- New Member
- Posts: 2
Geo Ce wrote: My solution:
Step 1: Edit "(JOOMLA_PATH)/libraries/vendor/joomla/registry/src/Registry.php"
Step 2:
In line 366 replace:
$obj = $handler->stringToObject($data, $options);
to
$obj_count = json_decode($data);
if(count($obj_count) > 0) {
$obj = $handler->stringToObject($data, $options);
} else {
$obj = $obj_count;
}
And everything is back to normal!
Thank you Geo Ce... it managed to overcome my problem
Thank you very much
greetings from me , I hope you succeed
Please Log in or Create an account to join the conversation.
- WinniePooh
-
- Offline
- Senior Member
- Posts: 55
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Some items might have been saved or imported incorrectly.
We cannot alter existing items.
Please Log in or Create an account to join the conversation.
- Arthur Johnston
-
- Offline
- New Member
This is not directly related to K2.
Some items might have been saved or imported incorrectly.
We cannot alter existing items.
Using Joomla 3.75, PHP7.0 and new install of K2 v2.8, after importing Joomla Content.
When accessing the imported content results in 0 Error decoding JSON data: syntax Error.
Note: The error did not occur until after the installation of K2.
One explanation of the issue is:
The Issue
Joomla stores rules and parameters in the database in JSON format. Previously, if that data was invalid JSON it would silently fail and the site would continue working.
In the 3.6.3 update, the validation of the syntax was improved, so issues that would previously go unnoticed now result in an error page with the aforementioned error message.
Known Causes
JBLibrary plugin - Causes errors on the frontend of the site, fixed in version 2.1.7
Jupgrade - Sites migrated from Joomla 1.5 using this extension.
Many other 3rd party extensions and core extensions have been mentioned.
How to Fix
Sites that have been migrated using Jupgrade may have empty parameter fields set as {""} which should either be {} or {"":""} to be valid syntax. This may be the same with other 3rd party extensions added to any site.
This is the easiest issue to fix and can be done with a simple search and replace on the database.
reference:
www.robertwent.com/blog/fixing-json-data-errors-after-updating-to-joomla-3-6-3/
Arthur Johnston
Meadowbrook Kennels
Home of SeaCrest Cockers & Meadowbrook Border Terriers
<=-Quality-Temperament-Confirmation-=>
seacrestcockers.com
Please Log in or Create an account to join the conversation.