Error when I try to use Course Enrolment by class

Hi,

When I am in the Course Enrolment by class option and I click on the Submit button without having selected a participant, Gibbon crashes with the following PHP error:

[Wed Nov 08 18:11:49.509454 2023] [php:error] [pid 832] [client 127.0.0.1:47154] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /var/www/gibbon.local/modules/Timetable Admin/courseEnrolment_manage_class_edit_addProcess.php:44\nStack trace:\n#0 {main}\n thrown in /var/www/gibbon.local/modules/Timetable Admin/courseEnrolment_manage_class_edit_addProcess.php on line 44, referer: http://localhost/index.php?q=%2Fmodules%2FTimetable+Admin%2FcourseEnrolment_manage_class_edit.php&gibbonSchoolYearID=025&gibbonCourseID=00000002&search=&gibbonCourseClassID=00000002

If I select a participant, everything works normally.

Do you want this type of error to be reported on the forum?

THANKS !

Sylvain
Gibbon : v25.0.01, PHP v8.1.2, MySQL v8.0.35, Ubuntu 22.04.3

Thanks @smarcil for the heads up, looks like this is related to the strict type checking that is being added in PHP 8+. I’ve fixed the error in the v26 development branch, which is due to release on Nov 20th. Please give a shout if you spot any other errors, thanks.