Advertisement:

Author Topic: Datatables JSON error in manage items  (Read 3937 times)

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Datatables JSON error in manage items
« on: April 26, 2011, 08:32:58 pm »
I know that some users have been experiencing some issues in manage items in the oc-admin.

If I'm not wrong, the problem happens when the mb_substr isn't loaded (here more information: http://php.net/manual/en/book.mbstring.php).

In order to test if your configuration load mb_substr function, you can use this code: https://gist.github.com/942516

If you haven't mb_substr function loaded, you should add this code in ./oc-includes/osclass/utils.php file: https://gist.github.com/942527

I've tested it uninstalling my multibyte string extension and it's worked fine. However if someone that have been experiencing this problem can give us feedback, we'll appreciate it.

Finally, I want to thanks Juanjo, that it's the user that has reported the solution!

vnguyen745

  • Newbie
  • *
  • Posts: 25
Re: Datatables JSON error in manage items
« Reply #1 on: April 27, 2011, 06:24:18 am »
WORKED LIKE A CHARM!!!  Thank you so much!!!  All i did was add that code to the utils.php

umbilu

  • Newbie
  • *
  • Posts: 5
Re: Datatables JSON error in manage items
« Reply #2 on: April 27, 2011, 06:47:29 pm »
Sorry but i have try the script these is result:   Function mb_substr exists.

Wath's a problem i have ?

umbilu

  • Newbie
  • *
  • Posts: 5
Re: Datatables JSON error in manage items
« Reply #3 on: April 27, 2011, 07:21:50 pm »
i have the same problem with manage items:
DataTables warning: JSON data from server failed to load or be parsed. This is most likely to be caused by a JSON formatting error.

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Datatables JSON error in manage items
« Reply #4 on: April 28, 2011, 03:01:24 pm »
@umbilu: Can you give us more information? Your OSClass version, if you're using Apache or IIS, the browser you're using... If you want, I can help you debugging your installation in your hosting, write me an e-mail to juanramon@osclass.org

pgranero

  • Newbie
  • *
  • Posts: 25
Re: Datatables JSON error in manage items
« Reply #5 on: May 04, 2011, 04:32:52 pm »
I've the same problem and I tested the script "Function mb_substr exists"

I've this error with

Client
------
 Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
 and I also probed IE 6.0.29

Server
------
XP
XAMP 1.7.4
    Apache 2.2.17
    MySQL 5.5.8
    PHP 5.3.5

This error raised after add an item and when you want to see it
I've 2 alert with the same error
The full message is:
Data Tables warning: JSON data from server failed to load or to be parsed. This is most likely to be caused by JSON formating error

Regards
Pablo

ianfrizell

  • Newbie
  • *
  • Posts: 19
Re: Datatables JSON error in manage items
« Reply #6 on: May 05, 2011, 03:39:29 pm »
Hi

I'm having the same problem.

I tried to add an item to the database via the admin tool (as a specific user) and got an error box with the following message: "DataTables warning: JSON data from server failed to load or be parsed. This is most likely to be caused by a JSON formatting error.".  The admin tool does not display anything from the item table (it just shows the JSON error as above), but if I log in to the website, the item appears in the user's list of items.

I have added the suggested code to my utils.php, but still have this problem

I'm running OSClass 2.0.2  on Apache 2 under Linux, PHP 5.2.13, MySQL 5.0.91.  Have tried with both Firefox 4 and Google Chrome 11.0.696.60 browsers.

Regards,

Ian Frizell

ianfrizell

  • Newbie
  • *
  • Posts: 19
Re: Datatables JSON error in manage items
« Reply #7 on: May 05, 2011, 03:44:52 pm »
Hi

Have now disabled Analytics as suggested for 000webhost.com.  I can now see the items held on the item table, but the JSON error message still appears...

Regards,

Ian Frizell

ianfrizell

  • Newbie
  • *
  • Posts: 19
Re: Datatables JSON error in manage items
« Reply #8 on: May 05, 2011, 04:03:21 pm »
Hi

The JSON error message has now stopped appearing - perhaps something was being cached in spite of a Ctrl-F5 refresh?

Anyway,  it all seems fine now - thanks for the solution!

Regards,

Ian Frizell