Report generation error due to attendance component

Dear Ross and Sandra
This semester’s reports are ready to be generated, but Gibbon is giving me the Oh no, the gibbons have…"! screen. It works when I remove the attendance block in the report builder.

I desperately need to fix this… Maybe the following will help you point me in the right direction.

Again, thanks a million for the wonderful work…

I’m using PHP 8.0 and have recently upgraded from Ubuntu 18 to 20 on my server.

The error log was showing: AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/gibbon/modules/Reports/src/Sources/AttendanceByCycle.php:120\nStack trace:\n#0 [internal function]: Gibbon\Module\Reports\Sources\AttendanceByCycle->Gibbon\Module\Reports\Sources\{closure}()\n#1 /var/www/gibbon/modules/Reports/src/Sources/AttendanceByCycle.php(121): array_filter()\n#2 [internal function]: Gibbon\Module\Reports\Sources\AttendanceByCycle->Gibbon\Module\Reports\Sources\{closure}()\n#3 /var/www/gibbon/modules/Reports/src/Sources/AttendanceByCycle.php(92): array_map()\n#4 /var/www/gibbon/modules/Reports/src/DataFactory.php(60): Gibbon\Module\Reports\Sources\AttendanceByCycle->getData()\n#5 /var/www/gibbon/modules/Reports/src/ReportBuilder.php(146): Gibbon\Module\Reports\DataFactory->buildReportData()\n#6 /var/www/gibbon/modules/Reports/reports_generate_singleProcess.php(80): Gibbon\Module\Reports\ReportBuilder->buildReportSingle()\n#7 {main}\n thrown in /var/www/gibbon/modules/Reports/sr…’, referer: https://gibbon…/index.php?q=%2Fmodules%2FReports%2Freports_generate_single.php&gibbonReportID=0000000029&contextData=008

And is now showing, the following in addition to the above.
[Mon Jun 26 11:45:36.574461 2023] [autoindex:error] [pid 598430] [client 179.210.173.21:43102] AH01276: Cannot serve directory /var/www/gibbon/modules/Reports/: No matching DirectoryIndex (index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive, referer: https://gibbon…/modules/Reports/reports_generate_singleProcess.php

Hi @pllabreu

It does look like there is a PHP 8 related value type error, but there shouldn’t necessarily be a string in the location that it’s throwing an error, which is odd. Which version of Gibbon are you using? I did make some improvements to type checking in the v26 development version of the AttendanceByCycle.php script. It should be backwards compatible, so you could try replacing your current /var/www/gibbon/modules/Reports/src/Sources/AttendanceByCycle.php script with the following: https://raw.githubusercontent.com/GibbonEdu/core/v26.0.00/modules/Reports/src/Sources/AttendanceByCycle.php

Hope this helps!

Dear Sandra, thank you so much for your help. It has apparently solved the issue. I found out right after posting that tinkering with attendance settings made the problem go away. Turning “Count Class Attendance as School Attendance” to YES and “Enable First Class as School Attendance” also set to YES produced the error, so we turned “Count Class Attendance as School Attendance” to No. But it created an issue for us: despite several slots, which we call “class”, they are taught by the same teacher and sometimes there are two teachers: one teaching a series of slots in English and another doing a series in Portuguese. If a attendance was set to present in one class, but absent or no attendance had been taken in another class, it showed as an absence. That’s why we needed both set to yes. It seems to be working now, and the number of absences seems to be right.
I will forever thank you and Ross for the wonderful job and for taking the time to help via forum.

1 Like