oliviervalentin / moodle-report_coursemanager

Course Managet is a report tool for Moodle for helping teachers to clean and manage their courses and contents. It is based on an automatic task which calculates reports, that are displayed in a general dashboard and directly in courses.
GNU General Public License v3.0
9 stars 6 forks source link

Courses not deleted in report_coursemanager_reports #60

Closed gmanaud closed 5 months ago

gmanaud commented 5 months ago

Hi (again ! ;) )

A course deleted manually (without using coursemanager and without being in trash category) isn't deleted in the report_coursemanager_reports table. This causes errors (« Can not find data record in database table course ») when trying to display courses without teacher in admin dashboard.

Maybe it would be necessary to test if course exists and if no, delete the record?

oliviervalentin commented 5 months ago

Hi (once again !! :D),

totally logical... I'll do this for courses without teachers page. Orphaned submissions page could also be impacted. I'll fix that as soon as possible. Maybe I should add in each task a function that starts to clean reports before creating/updating/deleting new calculations.

Olivier

gmanaud commented 5 months ago

Yes indeed, or maybe in a separate task that would be launched only if at least one report is enabled in the plugin settings?

oliviervalentin commented 5 months ago

I should add your name in co-credits for this plugin... :)

oliviervalentin commented 5 months ago

I have updated "courses without teachers" admin page.

The reports cleaning will be added as a task soon.