[Xerte-dev] Re: Invalid backend response. Data is not JSON.

Tom Reijnders reijnders at tor.nl
Mon Apr 13 13:35:17 BST 2015


Brad,

connector.php is custom code (written by me). Could you try the following:

|//session_start();

require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."../../../config.php");
|

It will start the session in exactly the same way as it is started in 
other parts of Xerte. I've verified that this keeps working in normal 
circumstances. Could you please check if this solves your issue? Than I 
will commit the fix.

Thank you!

Tom


Smith, Bradley schreef op 10-4-2015 om 16:34:
> John,
>
> At least for me, the reason for the “Data is not JSON” error is that 
> elfinder isn’t using the same session as Xerte+moodle_auth, and when 
> it can’t find evidence of a login it redirects to index.php, the 
> output of which is the “invalid JSON” that is sent in response to the 
> AJAX call.
>
> See theissue report on GitHub 
> <https://github.com/thexerteproject/xerteonlinetoolkits/issues/222> for details. 
>
>
> Thanks for following up on this, Ron!
>
> —Brad
>
>> On Apr 10, 2015, at 7:37 AM, Smith, John <J.J.Smith at gcu.ac.uk 
>> <mailto:J.J.Smith at gcu.ac.uk>> wrote:
>>
>> Hi Ron,
>>
>> IT would seem like the data being sent from the server is not valid 
>> JSON but is somehow being corrupted. It would be useful to capture 
>> this data and the headers being sent (would have been available in 
>> the console) so that we can check it's structure. You don't say at 
>> what point you get the error. Does the editor fully load or is it 
>> during the load cycle that it happens? I've seen a few strange things 
>> happen with the editor where files load in the wrong order (something 
>> which should be handled more elegantly) and they continue to load in 
>> the wrong order when you refresh but if you close and reopen the 
>> editor or click in the address bar and press enter then they resolve...
>>
>> Regards,
>>
>> John Smith | Learning Technologist
>> Room A250, Govan Mbeki Building | School of Health & Life Sciences | 
>> Glasgow Caledonian University
>> Cowcaddens Road | Glasgow | G4 0BA
>>
>> Please address ALL support requests to hlsblt at gcu.ac.uk 
>> <mailto:hlsblt at gcu.ac.uk> where one of the School Learning 
>> Technologists will pick up the job. This will ensure that all jobs 
>> are completed as promptly as possible.
>> ________________________________________
>> From: xerte-dev-bounces at lists.nottingham.ac.uk 
>> <mailto:xerte-dev-bounces at lists.nottingham.ac.uk> 
>> [xerte-dev-bounces at lists.nottingham.ac.uk 
>> <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>] On Behalf Of Ron 
>> Mitchell [ronm at mitchellmedia.co.uk <mailto:ronm at mitchellmedia.co.uk>]
>> Sent: 10 April 2015 12:32
>> To: 'For Xerte technical developers'
>> Subject: [Xerte-dev] Re: Invalid backend response. Data is not JSON.
>>
>> Exploring this further I first tried using the purge all caches 
>> function via Moodle admin and same problem existed.
>> I then removed the integration_path from site_details and tried again 
>> via guest and all worked fine.
>> I then re-added the integration_path and tested again via guest and 
>> all still worked fine.
>> Changed auth_config back to using Moodle authentication and all still 
>> working fine.
>> Not sure if that helps apart from seemingly being a fix for a 
>> previously working install using Moodle authentication that had 
>> become broken but works again after removing and re-adding the 
>> integration_path. I guess somewhere these steps are killing the 
>> conflicting session or cache but not sure what's causing the conflict 
>> in the first place and clearly that's what we need to identify.
>> Ron
>>
>> From: xerte-dev-bounces at lists.nottingham.ac.uk 
>> <mailto:xerte-dev-bounces at lists.nottingham.ac.uk> 
>> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Ron 
>> Mitchell
>> Sent: 10 April 2015 12:06
>> To: 'For Xerte technical developers'
>> Subject: [Xerte-dev] Invalid backend response. Data is not JSON.
>>
>> Hi all
>> I'm posting here but have also posted to the issue reported by Brad I 
>> think at 
>> https://github.com/thexerteproject/xerteonlinetoolkits/issues/222
>>
>> I've been testing some stuff on a localhost xampp installation on and 
>> off over the last few days and again this morning. This is recent 
>> develop code but not the very latest. I'm not sure what caused this 
>> but now when I try to edit an existing or new LO and browser for 
>> media I get the following error:
>>
>> Invalid backend response. Data is not JSON.
>>
>> This happens regardless of account, browser, project etc and I've 
>> completely shut down xampp, cleared session files and re-started but 
>> still the same problem. I remember having similar problems in a much 
>> earlier test version on the Techdis server where there was more than 
>> one install and liaising with Tom but never resolving it then and in 
>> this local xampp instance there's only a singe XOT install. It also 
>> inside a Moodle directory like the Techdis server was but has been 
>> working fine until this problem arose this morning and now even with 
>> auth_config set to guest or static effectively the install is broken 
>> because it's not possible to browse for media. In this case I can 
>> potentially just scrap and replace the install but I seem to recall 
>> when I tried that on the Techdis server previously it didn't resolve 
>> the problem and I'm worried about this happening on live 
>> installations. There are plenty using Moodle authentication.
>>
>> Any additional ideas re cause/solution?
>>
>> This happens when the pop-up opens:
>> http://localhost/moodle/xerte/editor/elfinder/browse.php?type=media&lang=en
>>
>> And the FF console shows 2 repeat errors:
>> Line 1339 toolbox.js
>> console.log('Browse file: ' + id + ': ' + key + ', ' +  name  + ', ' 
>> +  value);
>>
>> Cheers
>> Ron
>>
>>
>>
>>
>>
>>
>>
>> This message and any attachment are intended solely for the addressee
>>
>> and may contain confidential information. If you have received this
>>
>> message in error, please send it back to me, and immediately delete it.
>>
>>
>>
>> Please do not use, copy or disclose the information contained in this
>>
>> message or in any attachment.  Any views or opinions expressed by the
>>
>> author of this email do not necessarily reflect the views of the
>>
>> University of Nottingham.
>>
>>
>>
>> This message has been checked for viruses but the contents of an
>>
>> attachment may still contain software viruses which could damage your
>>
>> computer system, you are advised to perform your own checks. Email
>>
>> communications with the University of Nottingham may be monitored as
>>
>> permitted by UK legislation.
>>
>>
>>
>>
>> This message and any attachment are intended solely for the addressee
>> and may contain confidential information. If you have received this
>> message in error, please send it back to me, and immediately delete it.
>>
>> Please do not use, copy or disclose the information contained in this
>> message or in any attachment.  Any views or opinions expressed by the
>> author of this email do not necessarily reflect the views of the
>> University of Nottingham.
>>
>> This message has been checked for viruses but the contents of an
>> attachment may still contain software viruses which could damage your
>> computer system, you are advised to perform your own checks. Email
>> communications with the University of Nottingham may be monitored as
>> permitted by UK legislation.
>>
>>
>>
>> Glasgow Caledonian University is a registered Scottish charity, 
>> number SC021474
>>
>> _______________________________________________
>> Xerte-dev mailing list
>> Xerte-dev at lists.nottingham.ac.uk
>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>>
>>
>>
>>
>> This message and any attachment are intended solely for the addressee
>> and may contain confidential information. If you have received this
>> message in error, please send it back to me, and immediately delete it.
>>
>> Please do not use, copy or disclose the information contained in this
>> message or in any attachment.  Any views or opinions expressed by the
>> author of this email do not necessarily reflect the views of the
>> University of Nottingham.
>>
>> This message has been checked for viruses but the contents of an
>> attachment may still contain software viruses which could damage your
>> computer system, you are advised to perform your own checks. Email
>> communications with the University of Nottingham may be monitored as
>> permitted by UK legislation.
>>
>
>
> This message and any attachment are intended solely for the addressee
> and may contain confidential information. If you have received this
> message in error, please send it back to me, and immediately delete it.
>
> Please do not use, copy or disclose the information contained in this
> message or in any attachment.  Any views or opinions expressed by the
> author of this email do not necessarily reflect the views of the
> University of Nottingham.
>
> This message has been checked for viruses but the contents of an
> attachment may still contain software viruses which could damage your
> computer system, you are advised to perform your own checks. Email
> communications with the University of Nottingham may be monitored as
> permitted by UK legislation.
>
>
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev

-- 
--

Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20150413/13a419e3/attachment-0001.html>


More information about the Xerte-dev mailing list