I would like to report some bugs when creating attendance dates on Attendance course module. I didn't have time to debug those right now, but maybe someone else or FormaLMS team can troubleshoot and fix them. I believe they're all JS related.
1. When adding a new date with "00:00:00" hour (e.g. "25-01-2024 00:00:00"), it register as a yesterday date (instead of adding it as "25-01-2024", it adds it to the list as "24-01-2024"). If the yesterday date (24-01-2024) already exists, if fails to add saying that an existing date already exists. I believe this issue happens because "00:00:00" is understood as yesterday (24-01-2024) instead of the date added (25-01-2024) on JS side, maybe a UTC to GTM issue?
2. If you try to remove a date you added before, and attempt to add it again, it fails stating that date already exists.
3. When attempting to edit an existing date, it says that the date already exists. The message is thrown if you change the value of some field or keep them as it is.
4. When adding or removing a date it throws the error below, but the dates is saved on back-end as expected.
Code: Select all
index.php?r=alms/classroom/classroomDateDays&id_course=4&id_date=1:782 Uncaught TypeError: data.days is not iterable
at Object.success (index.php?r=alms/classroom/classroomDateDays&id_course=4&id_date=1:782:42)
at i (jquery-1.12.3.min.js:2:27449)
at Object.fireWith [as resolveWith] (jquery-1.12.3.min.js:2:28213)
at y (jquery-1.12.3.min.js:4:22831)
at XMLHttpRequest.c (jquery-1.12.3.min.js:4:26989)
success @ index.php?r=alms/classroom/classroomDateDays&id_course=4&id_date=1:782
i @ jquery-1.12.3.min.js:2
fireWith @ jquery-1.12.3.min.js:2
y @ jquery-1.12.3.min.js:4
c @ jquery-1.12.3.min.js:4
XMLHttpRequest.send (async)
send @ jquery-1.12.3.min.js:4
ajax @ jquery-1.12.3.min.js:4
saveData @ index.php?r=alms/classroom/classroomDateDays&id_course=4&id_date=1:767