Problems after upgrading from Moodle 3.11 to 4.1

Problems after upgrading from Moodle 3.11 to 4.1

by P H -
Number of replies: 12

I have recently upgraded from 3.11 and php 7.3 to the following:

Moodle 4.1+ (Build: 20221209)
Boost 2022112800
PHP 8.0.26
Database (10.5.18-MariaDB)

I am facing several problems after the upgrade.

1. Images which are displayed correctly in the glossasry do not disdplay in the the crossword (game) activity. I have described it in detail at this link.

2. In the quiz the presence of some question types breaks the formatting of the page while some other question types display correctly. I have described this in detail at this link.

3. Some course cannot be accessed. The course title appears on the course search list but when you click on the view link, you get a blank page or the following error:
This page isn’t working
"Website name" is currently unable to handle this request.
HTTP ERROR 500

This is random. Some courses can be accessed and some though out error messages. 

This is not the first time I have upgraded Moodle and on previous occasions everything went on smoothly. 

What can be causing these problems? What would you recommend? 

Average of ratings: -
In reply to P H

Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
I have nailed down the cause of the third problem (error message while trying to access some courses). It affected courses which had the Fordson theme forced. I uninstalled the theme and those courses are now accessible.

I also noticed debugging error messages regarding "oublog" and "collapsible topic" format. I have uninstalled those too.

The problem with some question types breaking the formating (gapfill) or not rendering (cloze) persists with no error messages.

The problem with glossary questions not displaying in crossword persists and throws the following error:

*_get_completion_state() callback functions such as game_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_game\completion\custom_completion which extends \core_completion\activity_custom_completion.

line 729 of /lib/completionlib.php: call to debugging()
line 666 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 1538 of /lib/completionlib.php: call to completion_info->update_state()
line 1201 of /lib/grade/grade_grade.php: call to completion_info->inform_grade_changed()
line 267 of /lib/grade/grade_object.php: call to grade_grade->notify_changed()
line 1045 of /lib/grade/grade_grade.php: call to grade_object->update()
line 2086 of /lib/grade/grade_item.php: call to grade_grade->update()
line 291 of /lib/gradelib.php: call to grade_item->update_raw_grade()
line 507 of /mod/game/lib.php: call to grade_update()
line 1010 of /mod/game/locallib.php: call to game_grade_item_update()
line 238 of /mod/game/cross/crossdb_class.php: call to game_updateattempts()
line 160 of /mod/game/cross/crossdb_class.php: call to CrossDB->game_cross_computecheck()
line 175 of /mod/game/cross/play.php: call to CrossDB->loadcross()
line 51 of /mod/game/cross/play.php: call to game_cross_play()
line 227 of /mod/game/attempt.php: call to game_cross_continue()
line 201 of /mod/game/attempt.php: call to game_create()
line 40 of /mod/game/attempt.php: call to game_do_attempt()

*_get_completion_state() callback functions such as game_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_game\completion\custom_completion which extends \core_completion\activity_custom_completion.

line 729 of /lib/completionlib.php: call to debugging()
line 666 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 1538 of /lib/completionlib.php: call to completion_info->update_state()
line 1201 of /lib/grade/grade_grade.php: call to completion_info->inform_grade_changed()
line 267 of /lib/grade/grade_object.php: call to grade_grade->notify_changed()
line 1045 of /lib/grade/grade_grade.php: call to grade_object->update()
line 2086 of /lib/grade/grade_item.php: call to grade_grade->update()
line 291 of /lib/gradelib.php: call to grade_item->update_raw_grade()
line 507 of /mod/game/lib.php: call to grade_update()
line 439 of /mod/game/lib.php: call to game_grade_item_update()
line 1011 of /mod/game/locallib.php: call to game_update_grades()
line 238 of /mod/game/cross/crossdb_class.php: call to game_updateattempts()
line 160 of /mod/game/cross/crossdb_class.php: call to CrossDB->game_cross_computecheck()
line 175 of /mod/game/cross/play.php: call to CrossDB->loadcross()
line 51 of /mod/game/cross/play.php: call to game_cross_play()
line 227 of /mod/game/attempt.php: call to game_cross_continue()
line 201 of /mod/game/attempt.php: call to game_create()
line 40 of /mod/game/attempt.php: call to game_do_attempt()

*_get_completion_state() callback functions such as game_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_game\completion\custom_completion which extends \core_completion\activity_custom_completion.

line 729 of /lib/completionlib.php: call to debugging()
line 666 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 1538 of /lib/completionlib.php: call to completion_info->update_state()
line 1201 of /lib/grade/grade_grade.php: call to completion_info->inform_grade_changed()
line 267 of /lib/grade/grade_object.php: call to grade_grade->notify_changed()
line 1045 of /lib/grade/grade_grade.php: call to grade_object->update()
line 2086 of /lib/grade/grade_item.php: call to grade_grade->update()
line 291 of /lib/gradelib.php: call to grade_item->update_raw_grade()
line 507 of /mod/game/lib.php: call to grade_update()
line 1410 of /mod/game/locallib.php: call to game_grade_item_update()
line 1015 of /mod/game/locallib.php: call to game_save_best_score()
line 238 of /mod/game/cross/crossdb_class.php: call to game_updateattempts()
line 160 of /mod/game/cross/crossdb_class.php: call to CrossDB->game_cross_computecheck()
line 175 of /mod/game/cross/play.php: call to CrossDB->loadcross()
line 51 of /mod/game/cross/play.php: call to game_cross_play()
line 227 of /mod/game/attempt.php: call to game_cross_continue()
line 201 of /mod/game/attempt.php: call to game_create()
line 40 of /mod/game/attempt.php: call to game_do_attempt()

*_get_completion_state() callback functions such as game_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_game\completion\custom_completion which extends \core_completion\activity_custom_completion.

line 729 of /lib/completionlib.php: call to debugging()
line 666 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 1024 of /mod/game/locallib.php: call to completion_info->update_state()
line 238 of /mod/game/cross/crossdb_class.php: call to game_updateattempts()
line 160 of /mod/game/cross/crossdb_class.php: call to CrossDB->game_cross_computecheck()
line 175 of /mod/game/cross/play.php: call to CrossDB->loadcross()
line 51 of /mod/game/cross/play.php: call to game_cross_play()
line 227 of /mod/game/attempt.php: call to game_cross_continue()
line 201 of /mod/game/attempt.php: call to game_create()
line 40 of /mod/game/attempt.php: call to game_do_attempt()
Average of ratings: Useful (1)
In reply to P H

Re: Problems after upgrading from Moodle 3.11 to 4.1

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Basically, your issues are stemming from plugins that most likely are no longer compatible. You need to look at the games plugin and see if there is a version for 4.1 and if so, get it upgraded. Fordson is not compatible with 4.xx - Chris released a different theme for the 4.xx versions so you will need to look for a new theme.
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
I understand and I am looking into it, but what about the issue with cloze questions (which is core Moodle) not rendering?


<p>True, false, or "we don't know"?</p>

<ol>

    <li>Susan can swim well. {1:MC:=True~False~We don't know}</li>

    <li>She has a boyfriend. {1:MC:=True~False~We don't know}</li>

    <li>Jim likes Brenda. {1:MC:~True~False~=We don't know}</li>

    <li>Susan's family are very rich. {1:MC:~True~=False~We don't know}</li>

</ol>

In reply to P H

Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
I can now report that problems 1 and 2 seem to be linked to php version.

When I revert back to php 7.3, the formatting and rendering problems go away, but this breaks my site's backend.

When I switch to php 7.4 or 8.0, the problems come back.

I am looking into plugin incompatibility with php above 7.3. I am examining the plugins one by one and deleting any older ones that I don't absolutely need. 

But I don't think this is exclusively a plugin compatibility issue as it also affects the rendering of cloze questions, which is core Moodle.

Any suggestions?
In reply to P H

Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
After poring over this problem for days and leaving (almost) no stones unturned, I have finally located and rectified the problem.

For other Moodlers who may run into this something similar, it seems that Moodle 4.1 (and 4.0 probably?) is not compatible with the "tidy" php extension.

Deactivating the tidy extension resolves all the problems. I have tested this with php 7.4 and php 8.0. 

Thank you @MarcusGreen and @EmmaRichardson for your help. 
Average of ratings: Useful (1)
In reply to P H

Re: Problems after upgrading from Moodle 3.11 to 4.1

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Glad you solved the riddle.
May I ask why you were using the PHP tidy extension on your Moodle site?
In reply to Joseph Rézeau

Ri: Re: Problems after upgrading from Moodle 3.11 to 4.1

by Sergio Rabellino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
This is pretty normal installation, Moodle uses the Tidy extension into the HTML purifier filter i.e.
Not installing Tidy, the corresponding cleaner for HTML will not apply any cleanup to strings (and potentially you can have breaks in pages. Now why in this installation you got problems on close, should be investigated deeply, IMHO.
Average of ratings: Useful (2)
In reply to Sergio Rabellino

Re: Ri: Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
Out of nowhere the problem came back today with a student sending me the following screenshot!
I have made no changes to PHP since the last time I posted here and just checked and the "tidy" extension is still disabled.
Any idea what may be happening!
(Moodle 4.1 and PHP 8.0)
 

In reply to P H

Re: Ri: Re: Problems after upgrading from Moodle 3.11 to 4.1

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
What other changes have been made?
In reply to Emma Richardson

Re: Ri: Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
Not any changes on my side and my hosting service say that there had been no changes on their end to the PHP configuration either. I asked them to look further into it and they got back to me later saying that they had now set PHP extension mysqli to nd_msqli and asked me if had resolved the problem, which it had.
In reply to P H

Re: Ri: Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
For anyone interested, changing the PHP extension mysqli to nd_msqli solved the problem.
In reply to Joseph Rézeau

Re: Problems after upgrading from Moodle 3.11 to 4.1

by P H -
As Sergio has mentioned it was part of the default php setup when I upgraded to 7.4 and 8.0.