Closed jefft closed 5 months ago
The problem originated about a year ago, when getAttendances()
output was modified to add *
characters to indicate 'planned absence':
The 'view attendance' code wasn't modified to take this into account, so $x
would be 0*
instead of 0
in this line:
https://github.com/tbar0970/jethro-pmm/blob/f525298a798b7df136d36c5a1a02e86e22e89b38/views/view_6_attendance__2_display.class.php#L485
PHP is a YOLO language where 0 + '0*'
evaluates to 0 and 0+'1*'
evaluates to 1, so the code works but we get errors. See https://github.com/tbar0970/jethro-pmm/pull/1051 for suggested fix.
This bug doesn't affect end users, but generates error logs:
To replicate:
Create a Planned Absence for someone, e.g. yourself. To do this, find your Person record, go to the Rosters tab and add a planned absence for the upcoming Sunday (23 June here):
Go to Attendance -> Record, select the upcoming Sunday as the date, and record yourself Absent:
Go to Attendance -> Display and verify that your record is
(A)
to denote a planned absence:Change the format from
Sequential
toDate Totals
and click 'Go'. Your record will have a0
total, and an error will be logged.