Jason problem in Messages

Jason problem in Messages

by Amir Ali Dadras -
Number of replies: 3

Hello everyone,

When I send a message ( via http://XXXXXXXXX/message/index.php), I got this error:

JSON.parse: unexpected character at line 1 column 1 of the JSON data

Although the message has been sent and just needs a refresh to be shown on the page!


Please help!


Average of ratings: -
In reply to Amir Ali Dadras

Re: Jason problem in Messages

by Gunnar Restorff -

I have exactly the same problem. Did you find out a solution?

In reply to Gunnar Restorff

Re: Jason problem in Messages

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Look in the response part of the return message in the network tab of the browser for the call and see what the error is.

In reply to Amir Ali Dadras

Re: Jason problem in Messages

by Pedro Fernández -

We were having that same error. After debugging the response, as Gareth J Barnard suggests, we discovered that the problem was that "Debugging emails" was set to active in the site configuration. If this setting is active, the response after a new message is posted is a list of SMTP related messages, which are not valid JSON.

After deactivating the debugging emails option, the error disappeared and the messages plugin works as expected, without the need to reload the page with every message.


Kind regards.