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

cron is broken when deleting uncompleted users

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      Hide

      see replication instructions

      Show
      see replication instructions
    • Workaround:
      Hide

      The delete_user() needs $user->email and requires $user->auth. But the cronlib selects id and username only.
      So I added them.
      But I don't know how to remove the tailing end of line in the last line, sorry.

      Show
      The delete_user() needs $user->email and requires $user->auth. But the cronlib selects id and username only. So I added them. But I don't know how to remove the tailing end of line in the last line, sorry.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w29_MDL-28182_m22_userdel

      Description

      in cron's ourput:

      done.
      Running clean-up tasks...
      PHP Notice: Undefined property: stdClass::$email in /var/www/xxxx/lib/moodlelib.php on line 3516

      Notice: Undefined property: stdClass::$email in /var/www/xxxx/lib/moodlelib.php on line 3516
      PHP Notice: Undefined property: stdClass::$auth in /var/www/xxxx/lib/moodlelib.php on line 3533

      Notice: Undefined property: stdClass::$auth in /var/www/xxxx/lib/moodlelib.php on line 3533

      Default exception handler: Authentication plugin {$a} not found. Debug:

      • line 429 of /lib/setuplib.php: moodle_exception thrown
      • line 3208 of /lib/moodlelib.php: call to print_error()
      • line 3533 of /lib/moodlelib.php: call to get_auth_plugin()
      • line 229 of /lib/cronlib.php: call to delete_user()
      • line 61 of /admin/cli/cron.php: call to cron_run()

      !!! Authentication plugin {$a} not found. !!!
      !! Stack trace: * line 429 of /lib/setuplib.php: moodle_exception thrown

      • line 3208 of /lib/moodlelib.php: call to print_error()
      • line 3533 of /lib/moodlelib.php: call to get_auth_plugin()
      • line 229 of /lib/cronlib.php: call to delete_user()
      • line 61 of /admin/cli/cron.php: call to cron_run()
        !!

      Replication instructions:
      1. $CFG->deleteincompleteusers = 1;
      2. Create an uncompleted user ( confirmed = 1, lastaccess = 1, deleted = 0, email = '' )
      3. run the cron

      I tested it and the patch in 2.0.3 only. And the master is using the same code with 2.0.3

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11