moodle-an-hochschulen / moodle-local_profilecohort

Moodle plugin which lets admins manage cohort memberships based on users' custom profile fields
GNU General Public License v3.0
23 stars 19 forks source link

Make sure that the scheduled task really updates all cohorts #38

Open abias opened 2 years ago

abias commented 2 years ago

It has been reported outside Github that the scheduled task apparently does not update all existing cohorts / rules for all users. There may be cases when a user's profile field value is changed, his cohort memberships are not updates until his next login even though the schedule task runs properly in the meantime.

This behaviour should be investigated.

christianabila commented 3 months ago

The scheduled task update_cohorts only runs, if changes to the profile cohort form have been made (based off https://github.com/moodle-an-hochschulen/moodle-local_profilecohort/commit/c9ffb359e2f23e03f4c483342c5d1bbb52fc88b2)

I guess it's a safeguard for performance reasons?

Also, in the case of auth_db, user update events are suppressed in the core code https://github.com/moodle/moodle/blob/main/auth/db/auth.php#L395 - so automatic updates to the cohorts are not done at all.