Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11571

longtimenosee unenrolments not working correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dougiamas Martin Dougiamas
              Reporter:
              dougiamas Martin Dougiamas
              Tester:
              Nobody
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08