Upgrading 3.5.1+ to 3.8.4+

Upgrading 3.5.1+ to 3.8.4+

by Suheel Athamneh -
Number of replies: 6

Hello everyone, 

Hope my message finds you well, 

in the past few weeks, we had a project to upgrade our current Moodle site from 3.4 to 3.8 as we are running some plugins are not compatible with newer versions of Moodle. the 3.8.4+ was the only version we could upgrade to. so long story short, all the upgrade process and pain throughout was ok until we stumbled upon the following error 

SyntaxError: Unexpected token _ in JSON at position 0

    at parse (<anonymous>)
    at ajaxConvert (https://mymoodlesite/lib/javascript.php/-1/lib/jquery/jquery-3.5.1.js:9260:19)
    at done (https://mymoodlesite/lib/javascript.php/-1/lib/jquery/jquery-3.5.1.js:9736:15)
    at XMLHttpRequest.<anonymous> (https://mymoodlesite/lib/javascript.php/-1/lib/jquery/jquery-3.5.1.js:10047:9)

This error occurs when accessing an assignment and attempt to grade it. I've tried all possible solutions that I could linked them to but no luck. 
additional information about my setup.
I am running Moodle 3.8.4+ (Build: 20200827) on Ubuntu 18.04.5 LTS with PHP 7.2.24 and MySQL 5.7.32
The actions have taken so far to troubleshoot are
  1. upgrade jQuery from 3.4.1 to 3.5.1
  2. disable JavaScript caching
  3. looking around for permission/ownership issues.

The only output could lead to something, I can see on my browser console that there is a warning on depreciated function on XMLHttpRequest if this could help.

I look forward for your contribution to this, your assistance is highly appreciated.

Best.

Suheel.



Average of ratings: -
In reply to Suheel Athamneh

Re: Upgrading 3.5.1+ to 3.8.4+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Upgrading Moodle's jQuery sounds like a mistake: both the Moodle version itself and us on this forum will expect components – and the behaviour of these – to be consistent with those available from moodle.org. By changing these you have a version which is unlike anybody else's which makes supporting the site difficult.

Can you tell us what additional plugins the site has? Any assignment plugins?

Using your browser's developer tools (e.g. Network Monitor in Firefox) you should be able to see the network requests made when the error occurs. Try to find the requests that have a Type of "json", click on each and see what's in the response payload, e.g.:

Firefox's Network Tools showing the JSON response to an XHR request in Moodle

The response should be structured data contained in {} and [], presumably the response causing the error starts with an underscore ('_'). If you can find this request and tell us the request's URL and what's in the response hopefully we'll be further towards a solution.

Also: why 3.8.4 and not 3.8.6 which is the the most recent 3.8.x release?


Average of ratings: Useful (1)
In reply to Leon Stringer

Re: Upgrading 3.5.1+ to 3.8.4+

by Suheel Athamneh -
Thank you so much for the prompt reply @leon, Indeed we have multiple assignment plugins we use as the following.



Do you think it could be one of them?. I also reverted my upgrade of jQuery to the original state. I am now testing with 3.8.6 instead of 3.8.4+

by the way, I am randomly getting this message in the console. 

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

Thank you for your patience and help!

Best.
Suheel.

In reply to Suheel Athamneh

Re: Upgrading 3.5.1+ to 3.8.4+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

From your screenshot it looks like there are no additional assignment feedback plugins and three additional assignment submission plugins:

  1. Cloud Poodll submissions
  2. Online audio recording
  3. Online Poodll submissions

Can you tell us the versions of these? This is shown under Site administration > Plugins > Plugins overview, click Additional plugins at the top to only see these. Ideally you should have the latest versions that support Moodle 3.8. If the Online audio recording is this plugin then I don't think this plugin works with Moodle 3.8.

When there's an unexpected problem in Moodle then additional plugins are one of the first things to check as they alter Moodle's behaviour and functionality and may introduce problems as they add a third party's source code into the site. It's possible that a non-assignment additional plugin could be involved in this problem too.

I don't think the "[Deprecation]" warning is causing this problem although it might be a symptom.

In reply to Leon Stringer

Re: Upgrading 3.5.1+ to 3.8.4+

by Suheel Athamneh -



This is the only plugin that shows old date and enabled. is there any replacement and how can I preserve the previous data associated with this plugin? is there a way to disable it and test the functionality of moodle site?

In reply to Suheel Athamneh

Re: Upgrading 3.5.1+ to 3.8.4+

by Suheel Athamneh -
A quick update, in my test environment I uninstalled the plugin and all the functionality is back to normal. seems this plugin is causing the problem.

My question now, what is the alternative to this one, is there any recommendation?

Thanks a million!
In reply to Suheel Athamneh

Re: Upgrading 3.5.1+ to 3.8.4+

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

"how can I preserve the previous data associated with this plugin?" – If the plugin worked on the 3.5.1 site and you have a backup of that site – both database and Moodledata – then I would suggest keeping that as an archive copy of the site, not generally available to users but where old submissions can be retrieved from.

"is there any replacement"? – Using online text submissions students can use the Record Audio button in the text editor:

Atto toolbar with 'Record audio' button highlighted