Moodle

longtimenosee unenrolments not working correctly

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.2, 1.9
  • Fix Version/s: 1.9
  • Component/s: Roles / Access
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The bit in cron that uses CFG->longtimenosee to unenrol people who haven't been there for a long time was not quite working correctly.

1) get_users_longtimenosee was indexing the array on userid, which meant multiple old enrolments were being combined into one entry that missed some
2) entries where timeaccess was zero was not beng deleted ever

This means that user_lastaccess and role_assignments were growing with uneccessary entries, to the point where memory limits were reached and in the end NO unenrolments were happening at all.

On top of this:

3) The function should probably use get_recordset to avoid the memory thing totally.

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

1 and 2 are fixed

Show
Martin Dougiamas added a comment - 1 and 2 are fixed
Hide
Eloy Lafuente (stronk7) added a comment -

About 3)

  • Move the get_users_longtimenosee() function to deprecatedlib.php (marked for deletion for 2.0)
  • Re-implement as direct recordset in admin/cron.php
Show
Eloy Lafuente (stronk7) added a comment - About 3)
  • Move the get_users_longtimenosee() function to deprecatedlib.php (marked for deletion for 2.0)
  • Re-implement as direct recordset in admin/cron.php
Hide
Eloy Lafuente (stronk7) added a comment -

3) implemented (tested only in my small test environment, seems to work)

Show
Eloy Lafuente (stronk7) added a comment - 3) implemented (tested only in my small test environment, seems to work)

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: