Upgrading to PHP 7.4 causing problems in Moodle

Upgrading to PHP 7.4 causing problems in Moodle

by P H -
Number of replies: 8

I recently upgraded to PHP 7.4.16 (as my Wordpress installation recommended it) and today I am noticing some bizarre problems on my Moodle 3.10.1+ (Build: 20210226):

1. Only some of the the embedded items in a question are rendered. (Attached screenshots)

2. Formatting problems, such as the blanks in Gapfill questions breaking the line or even an ordered list becoming an unordered list halfway through. (Attached screenshots)

3. Other problems such as tables not rendering properly.

The questions display properly in the edit mode (and the HTNL code is correct) but upon saving or when they are displayed in a quiz, there are problems. 

These are questions that have been displaying and functioning smoothly for months and years. 

Could anyone shed some light on this? 

Average of ratings: -
In reply to P H

Re: Upgrading to PHP 7.4 causing problems in Moodle

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

What theme does the site use? If it's not Boost what is the version of the theme?

Make sure that Moodle has available fixes by updating to Moodle 3.10.5. Also, make sure any additional plugins are the latest available version. What version of Gapfill is installed?

It's probably worth purging caches.

Also enable debugging and check the PHP error logs.

In reply to Leon Stringer

Re: Upgrading to PHP 7.4 causing problems in Moodle

by P H -
Thank you for the prompt reply and suggestions:

1. I emptied all caches. No change.

2. My theme is Fordson (latest version). I switched to Boost. No change.

3. I have the latest version of Gapfill. And the problem is not only limited to Gapfill questions.

4. Debug activated. There are no error messages.
In reply to Leon Stringer

Re: Upgrading to PHP 7.4 causing problems in Moodle

by P H -
I can now confirm that the problem is the incompatibility between php 7.4 and my Moodle version:

1. I reverted back to PHP 7.2. All the problems disappeared in a instant.

2. I changed to PHP 7.3. Everything worked fine.

3. I changed to PHP 7.4. All the problems came back.

4. I switched back to 7.3. Everything seems to be working fine again.
In reply to P H

Re: Upgrading to PHP 7.4 causing problems in Moodle

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
HI P H, I am the author of the Gapfill question type. It looks like I should do some testing with PHP 7.4.
The release notes for Moodle 3.11 say 
"PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. ***PHP 7.4.x*** is supported too."
So it should be on my list of things to check.
In reply to Marcus Green

Re: Upgrading to PHP 7.4 causing problems in Moodle

by P H -
Hello Marcus,

Thanks for letting us know.

I lean more towards a Moodle (rather than a plugin) incompatibility as it affected not only Gapfill but also cloze questions.

I'm sure you'll let us know if you find out something interesting, won't you? smile

Have a good day!
In reply to P H

Re: Upgrading to PHP 7.4 causing problems in Moodle

by P H -
* an instant sad
In reply to P H

Re: Upgrading to PHP 7.4 causing problems in Moodle

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I have mistakenly ran Moodle with 7.4 in the recent past, and quite a few things broke, though they may have been 3rd party plugins.... But it will arrive eventually.
In reply to Marcus Green

Re: Upgrading to PHP 7.4 causing problems in Moodle

by Matthias Giger -
Picture of Particularly helpful Moodlers
Same problem here. After installing Moodle 3.11. I couldn't even update plugins when it was using PHP 7.4.