marcusgreen / moodle-qtype_gapfill

Fill in the blanks question type with very easy to learn syntax
6 stars 20 forks source link

Deprecated messages with PHP 8.1 #104

Closed rezeau closed 1 year ago

rezeau commented 1 year ago

Using Moodle 4.2 on Windows 11 Wampserver localhost PHP 8.1.13 Debug mode DEVELOPER: extra Moodle debug messages for developers Gapfill version 2023042000 When creating new Gapfill question and Preview, throws warning messages: Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in C:\wamp64\www\htdocs\moodle\question\type\gapfill\questiontype.php on line 161 Deprecated: htmlspecialchars_decode(): Passing null to parameter #1 ($string) of type string is deprecated in C:\wamp64\www\htdocs\moodle\question\type\gapfill\renderer.php on line 174

marcusgreen commented 1 year ago

Thanks Joseph, I have bumped the PHP version in the automated tests and it shows the error as you describe. I will work on a fix. Did you have debug set to developer?. Either way it needs fixing.

marcusgreen commented 1 year ago

I have now reproduced it locally and I suspect I know how I can fix both of those messages.

marcusgreen commented 1 year ago

Automated tests now passing https://github.com/marcusgreen/moodle-qtype_gapfill/actions/runs/4972604683/jobs/8897904821

Credit to my hero in the changelog https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/changelog.md

Will continue with more testing

marcusgreen commented 1 year ago

Closing this ticket as the issue has been addressed in version 2.138 Many thanks to Joseph for reporting this https://github.com/marcusgreen/moodle-qtype_gapfill/blob/master/changelog.md