Trying to list current users give JSON error

Bug #731153 reported by windmillway
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
webtrees
Fix Released
Critical
fisharebest

Bug Description

Selecting Administration/Users gives the following pop-up error

DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

All themes. currently at svn 11086

Revision history for this message
fisharebest (fisharebest) wrote :
Revision history for this message
windmillway (windmillway) wrote :
Download full text (5.8 KiB)

Greg

OK I have done that and get this downloaded report

{"sEcho":1,"iTotalRecords":"2","iTotalDisplayRecords":"2","aaData":[["","2","<span class=\"editable\" id=\"user-user_name-2\">guest<\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user-user_name-2\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\"})\n\/\/]]>\n<\/script>\n","<span class=\"editable\" id=\"user-real_name-2\">A Family Member<\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user-real_name-2\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\"})\n\/\/]]>\n<\/script>\n","<span class=\"editable\" id=\"user-email-2\"><\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user-email-2\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\"})\n\/\/]]>\n<\/script>\n","<div class=\"icon-email\" onclick=\"return message('guest');\"><\/div>","<span class=\"editable\" id=\"user_setting-2-language\"><\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user_setting-2-language\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {type:\"select\", data:{\"de\":\"Deutsch\",\"en_GB\":\"British English\",\"fr\":\"fran\\u00e7ais\",\"nl\":\"Nederlands\",\"he\":\"\\u05e2\\u05d1\\u05e8\\u05d9\\u05ea\",\"zh_CN\":\"\\u4e2d\\u6587\",\"selected\":null}, submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\", callback:function(value, settings) {jQuery(this).html(settings.data[value]);} })\n\/\/]]>\n<\/script>\n",null,"<span class=\"red\"><span class=\"date\">1 January 1970<\/span><span class=\"date\"> - 01:00:00<\/span><\/span>",null,"Never","<span class=\"editable\" id=\"user_setting-2-verified-\">no<\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user_setting-2-verified-\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {type:\"select\", data:{\"1\":\"yes\",\"0\":\"no\",\"selected\":0}, submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\", callback:function(value, settings) {jQuery(this).html(settings.data[value]);} })\n\/\/]]>\n<\/script>\n","<span class=\"editable\" id=\"user_setting-2-verified_by_admin-\">no<\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\njQuery(\"#user_setting-2-verified_by_admin-\").editable(\"http:\/\/localhost\/webtrees_svn\/save.php\", {type:\"select\", data:{\"1\":\"yes\",\"0\":\"no\",\"selected\":0}, submit:\"&nbsp;&nbsp;OK&nbsp;&nbsp;\", style:\"inherit\", placeholder: \"click to edit\", callback:function(value, settings) {jQuery(this).html(settings.data[value]);} })\n\/\/]]>\n<\/script>\n","<div class=\"icon-delete\" onclick=\"if (confirm('Permanently delete &quot;guest&quot;?')) { document.location='admin_users.php?action=deleteuser&username=guest'; }\"><\/div>"],["","1","<span class=\"editable\" id=\"user-user_name-1\">windmillway<\/span>\n<script type=\"text\/javascript\">\n\/\/<![CDATA[\...

Read more...

Revision history for this message
fisharebest (fisharebest) wrote :

That looks OK to me. Often, you'll get a PHP error here.

Try passing that value through json_decode()

e.g.

var_dump(json_decode('....'));

Revision history for this message
fisharebest (fisharebest) wrote :

I can see this error in my live not, but not my dev site.......

Changed in webtrees:
status: New → Confirmed
Revision history for this message
windmillway (windmillway) wrote :

Thanks Greg,

I'll be back in a couple of hours or so.
Shrove Tuesday, and Mum likes her pancakes (SWMBO)

Talk to you later

Brian

Revision history for this message
wooc (wooc) wrote :

I can confirm on my test site this error.

Revision history for this message
wooc (wooc) wrote :

In my bug console I see:
Inline script compilation
Syntax error at line 1 while loading:
{"sEcho":1,"iTotalRecords":"
--------^
expected ';', got ':'

Changed in webtrees:
importance: Undecided → Medium
Revision history for this message
fisharebest (fisharebest) wrote :

Can somebody check this with the previous version of jQuery / jQuery-UI ?

We upgraded recently, and I can see some JS errors that could be related....

Revision history for this message
windmillway (windmillway) wrote :

Thanks Greg.
I just rolled back svn 11070 and 11072 on my local copy, and the problem has gone.
I now can see my users again.

I guess Veit needs to sort this on the server?

Brian

Revision history for this message
windmillway (windmillway) wrote :

Or I can do the reversion if you like?

Brian

Revision history for this message
fisharebest (fisharebest) wrote :

No - we don't want to revert. We need to update our code to work with the updated library.

I think I saw where the problem is, but might not have time for a couple of days.

Revision history for this message
windmillway (windmillway) wrote :

OK

Revision history for this message
Rob Peters (makitso) wrote :

Just updated to the 3/15 snapshot build and this JSON error popped up. Is there a fix available yet?

Revision history for this message
kiwi (kiwi3685-deactivatedaccount) wrote :

Changed the priority of this. It seems to happen in many browsers. I found it using FF. It totally prevents any management of users, so a very critical issue.

Changed in webtrees:
importance: Medium → Critical
Revision history for this message
fisharebest (fisharebest) wrote :

I have raised this with the datatables developer.

http://datatables.net/forums/comments.php?DiscussionID=4538

Revision history for this message
fisharebest (fisharebest) wrote :

The problem is a conflict with the jquery.ajaxQueue.js plugin.

I'm not sure why we're using it. I know that jQuery 1.5 has rewritten the ajax handling, so perhaps this is no longer necessary.

Revision history for this message
fisharebest (fisharebest) wrote :

This problem seems to be known already:

http://plugins.jquery.com/content/ajaxqueue-json-calls-not-working-jquery-151

We are using ajaxQueue to solve the following problem:

Autocomplete makes many requests in rapid succession. If you type ABCD, it will send requests for A, AB, ABC and ABCD. However, on slow networks, these may be retrieved out of sequence, e.g A, AB, ABCD, ABC.

I have not been able to reproduce the problem - it is described as "intermittent" or "theoretical".

I shall remove this plugin. I've read that queueing features are now built in to jQuery. It is hopeful/possible that a later version of jquery.autocomplete will use this automatically.

Revision history for this message
fisharebest (fisharebest) wrote :

svn11205

Changed in webtrees:
assignee: nobody → fisharebest (fisharebest)
status: Confirmed → Fix Committed
Revision history for this message
ToyGuy (toyguy) wrote :

Great detective work, Greg. TNX

Revision history for this message
windmillway (windmillway) wrote :

That's wonderful Greg. Well done

Brian

Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in webtrees 1.1.2

Changed in webtrees:
status: Fix Committed → Fix Released
Revision history for this message
Gixmo (gixmo) wrote :

I get the same error message in 1.2.5:

DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

When opening : adminstration - users

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.