CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • JSON data from server could not be parsed.
Pages: [1]

Author Topic: JSON data from server could not be parsed.  (Read 4606 times)

GreatGuido

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.5.36-cll
  • PHP version: 5.4.19
JSON data from server could not be parsed.
March 29, 2014, 03:42:27 pm
When viewing a contact, click on Mailings (of which there are 3), and this error results.

Here is the full text of the message.
 - Data Tables warning: JSON data from server could not be parsed. This is caused by a JSON parsing error.

Where do I start to get diagnostic information for this error?


Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: JSON data from server could not be parsed.
March 29, 2014, 06:18:18 pm
I've seen this happen a lot when php spits out a warning or something and it breaks the json. In your php.ini file be sure that error and warning display is being suppressed.
Try asking your question on the new CiviCRM help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: JSON data from server could not be parsed.
March 30, 2014, 03:24:46 am
GreatGuido, try looking at the Net tab of Firebug for Firefox and see what the server is returning when you click on Mailings.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

GreatGuido

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.5.36-cll
  • PHP version: 5.4.19
Re: JSON data from server could not be parsed.
March 30, 2014, 06:35:54 pm
I think this is the detail you were looking for. Now what do I do?

<br />
<b>Warning</b>:  Missing argument 2 for CRM_Core_Action::formLink(), called in /home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/Mailing.php on line 2816 and defined in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>207</b><br />
<br />
<b>Warning</b>:  Missing argument 3 for CRM_Core_Action::formLink(), called in /home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/BAO/Mailing.php on line 2816 and defined in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>208</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>329</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>329</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>329</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/fog123/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Action.php</b> on line <b>329</b><br />
{"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Mail Test 39","<a href=\"http://forourgrandchildren.ca/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/contact/view&amp;reset=1&amp;cid=2\">Hanchet, Guy</a>","<a href=\"http://forourgrandchildren.ca/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/mailing/report/event&amp;mid=7&amp;reset=1&amp;cid=8&amp;event=queue&amp;context=mailing\">(recipients)</a>","March 30th, 2014 8:48 PM","Opens: 4<br />Clicks: ","<span><a href=\"http://forourgrandchildren.ca/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/mailing/view&amp;reset=1&amp;id=7\" class = \"action-item action-item-first crm-mailing-view\" title=\"View Mailing\">View</a><a href=\"http://forourgrandchildren.ca/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/mailing/report&amp;mid=7&amp;reset=1&amp;cid=8&amp;context=mailing\" class = \"action-item\" title=\"View Mailing Report\">Mailing Report</a></span>"]] }

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: JSON data from server could not be parsed.
March 30, 2014, 06:37:55 pm
Yep I was right. I already told you the solution though :/
Try asking your question on the new CiviCRM help site.

GreatGuido

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.5.36-cll
  • PHP version: 5.4.19
Re: JSON data from server could not be parsed.
March 30, 2014, 06:40:02 pm
I found a file called php.ini. This is all it says.

max_execution_time = 60;
memory_limit = 64M;
upload_max_filesize = 128M;
post_max_size = 128M;

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: JSON data from server could not be parsed.
March 30, 2014, 06:42:13 pm
That's a really general server admin question. Google has lots of answers: https://www.google.com/search?q=php+ini+suppress+warnings
Try asking your question on the new CiviCRM help site.

GreatGuido

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.5.36-cll
  • PHP version: 5.4.19
Re: JSON data from server could not be parsed.
March 30, 2014, 07:32:00 pm
Thanks,
I had already done that exact search and, while browsing the suggested responses, I realized that covering up warnings about missing and invalid arguments is NOT a solution. This is a bug. In some circumstances a temporary workaround to suppress a non-fatal bug by perhaps suppressing the warnings from only the php file that is generating them might be appropriate, but a global suppression of all warnings is pretty bad practice. In the long term such a habit leads to gradually deteriorating code quality. I think that instead I will submit a bug and live without the functionality until it is corrected properly.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: JSON data from server could not be parsed.
March 31, 2014, 06:47:15 am
Yes and no. PHP's warning threshold has gotten a bit stricter with each new version. So sometimes upgrading php will suddenly show a bunch of warnings that weren't there before. You don't want your website visitors to see them, so generally the practice is to suppress them on live sites but show them on development/staging environments.
We do our best to keep up with PHP's standards as they evolve, but CiviCRM is very big. Submitting a PR on github to fix it would be helpful.
Also I remember seeing a very similar topic to this one a couple weeks back on the forum, so this issue might already be fixed in master branch.
Try asking your question on the new CiviCRM help site.

GreatGuido

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.4
  • CMS version: Wordpress 3.8.1
  • MySQL version: 5.5.36-cll
  • PHP version: 5.4.19
Re: JSON data from server could not be parsed.
April 04, 2014, 10:39:14 am
good answer that puts a different spin on the idea. I'll try it. Thanks.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: JSON data from server could not be parsed.
May 21, 2014, 10:56:02 pm
We've also seen this - have logged

https://issues.civicrm.org/jira/browse/CRM-14731
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

aglozier

  • I post frequently
  • ***
  • Posts: 135
  • Karma: 9
    • Phoenix Academy
  • CiviCRM version: 4.7.9
  • CMS version: WordPress 4.6.1
  • MySQL version: 5.7.14
  • PHP version: 5.6.21
Re: JSON data from server could not be parsed.
May 28, 2014, 06:54:10 am
I have this error also and originally posted it here: http://forum.civicrm.org/index.php?topic=32493.new;topicseen#new.  I applied the patch located here: https://github.com/pratik-joshi/civicrm-core/compare/civicrm:4.4...CRM-14731 but it didn't fix it for me.  I still get the JSON error and the mailings aren't listed.

r4zoli

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 1
  • CiviCRM version: 4.7
  • CMS version: Wordpress
  • MySQL version: 5
  • PHP version: 5
Re: JSON data from server could not be parsed.
May 29, 2014, 01:13:56 pm
The fix didn't work for me, too. Get the JSON error.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • JSON data from server could not be parsed.

This forum was archived on 2017-11-26.