Moodle navigation stop working

Moodle navigation stop working

by Wei Miao -
Number of replies: 14

Hi,

My Moodle page navigation stop working, I think it is PHP configuration issue, but I don't know know to fix it, please help.

error log

Average of ratings: -
In reply to Wei Miao

Re: Moodle navigation stop working

by Matt T -
We need a bit more information about your environment.
* What Moodle version?
* Are you self-hosting using your own server/VPS, or using web hosting?
* If self-hosting using your own server/VPS, what web server software are you using?
* What PHP version are you using?
* Did you recently make any changes, and if so, what were they?
In reply to Matt T

Re: Moodle navigation stop working

by Wei Miao -

My Moodle is hosted on a VPS server with cPanel.

The only change I did recently is updating the server PHP version to 7.4, also changed the Moodle PHP version to 7.4. But I tried to change it back to 7.3, the error still happened.

Here is my Moodle environment report

report1



report2

In reply to Wei Miao

Re: Moodle navigation stop working

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

Try this test. Does the file exist on your site or not?

In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -
Yes, they do.
In reply to Wei Miao

Re: Moodle navigation stop working

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

You see the "XMPPHP is an elegant PHP library for XMPP" message? Then you've got files from previous Moodle versions mixed in with the Moodle 3.10 files. You need to make sure there are only Moodle 3.10 files in the source code folder, some of these can cause JavaScript errors. This reply says how to do this, basically follow the upgrade instructions.

In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -
I upgraded my Moodle with git, I just ran "git pull' command, is it the issue?
In reply to Wei Miao

Re: Moodle navigation stop working

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

Basically I'd seen some sites with JavaScript errors because they had files from old Moodle versions present. But if you're using Git that's unlikely the be the cause as Git will add, update and remove the files as needed. Can you run git status and tell us what it says?

Other potential causes of JavaScript errors are:

  1. Additional HTML being used to add JavaScript. Have you got anything in the fields under Site administration ▸ Appearance ▸ Additional HTML?
  2. An incompatible theme or additional plugin being used. Which theme does the site use? What additional plugins are installed?
  3. Modifications made to Moodle source code files. Git would report this and git pull would fail to work if this was the case.
In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -
I don't have any additional html added, and my theme is Moove, I tried to switch back to the moodle default theme, still has this error.
Here is the git status output:

On branch MOODLE_310_STABLE
Your branch is up to date with 'origin/MOODLE_310_STABLE'.

Untracked files:
(use "git add ..." to include in what will be committed)
.htaccess
admin/cli/error_log
auth/mo_saml/
auth/moowoodle/
availability/condition/coursecompleted/
enrol/apply/
mod/customcert/
mod/hvp/
report/coursesize/
theme/moove/

nothing added to commit but untracked files present (use "git add" to track)
In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -

I disabled the Cache Javascript option, and everything works fine now with PHP 7.4. I don't know why, and it is supposed to be enabled on production sites. 


adf

In reply to Wei Miao

Re: Moodle navigation stop working

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

If you turn it back on and purge caches do the errors appear?

In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -

I am wrong, disabling the catch javascript did fix the navigation issue, but I can not edit activities, here is the error I got.123

In reply to Wei Miao

Re: Moodle navigation stop working

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

At the top of the output is:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

for the file yui_combo.php. If you switch to the Network tab in the browser's developer tools you should see the request for this URL, something like:

GET theme/yui_combo.php?3.17.2/event-mousewheel/event-mousewheel.js&3.17.2/event-resize/event-resize.js&…

presumably alongside a 500 Internal Server Error. Can you check the server error logs to see if there are any messages corresponding to the above GET request?

What should be returned is a normal JavaScript file, for example this is what's returned on the Moodle demo site.

In reply to Leon Stringer

Re: Moodle navigation stop working

by Wei Miao -
Hi Leon,

I reset my server's php configuration, and everything working properly now. I don't know what's wrong with the previous configuration. I really appreciate your help with the troubleshooting, Thank you very much!