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

core_search: Cron output should use mtrace (also auth_db, enrol_ldap)

XMLWordPrintable

    • MOODLE_34_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MDL-60671-master
    • Hide

      These testing instructions just confirm that the cron output from text_progress_trace still works in the three main different ways you can run cron tasks - i.e. I didn't break it while making this change.

      1. Make sure the self enrolment plugin is enabled for the site.
      2. Change the value of $plugin->cron to 1 in enrol/self/version.php
      3. Enable self enrolment for a course
      4. Enable the admin setting so that you can run cron from the web interface (search: cronclionly and turn setting off).
      5. From the web interface, run cron (go to admin/cron.php)
        • EXPECTED: The output should contain the text "Verifying self-enrolments..."
      6. Wait at least 1 minute
      7. From the command line, run cron: php admin/cli/cron.php
        • EXPECTED: The output should contain the text "Verifying self-enrolments..."
      8. From the command line, run the scheduled task directly: php admin/tool/task/cli/schedule_task.php --execute=\\core\\task
        legacy_plugin_cron_task
      9. From the scheduled tasks screen, find the scheduled task (\core\task\legacy_plugin_cron_task) and click 'Run now'. Confirm the prompt.
        • EXPECTED: The output should contain the text "Verifying self-enrolments..."
      Show
      These testing instructions just confirm that the cron output from text_progress_trace still works in the three main different ways you can run cron tasks - i.e. I didn't break it while making this change. Make sure the self enrolment plugin is enabled for the site. Change the value of $plugin->cron to 1 in enrol/self/version.php Enable self enrolment for a course Enable the admin setting so that you can run cron from the web interface (search: cronclionly and turn setting off). From the web interface, run cron (go to admin/cron.php) EXPECTED: The output should contain the text "Verifying self-enrolments..." Wait at least 1 minute From the command line, run cron: php admin/cli/cron.php EXPECTED: The output should contain the text "Verifying self-enrolments..." From the command line, run the scheduled task directly:  php admin/tool/task/cli/schedule_task.php --execute=\\core\\task legacy_plugin_cron_task From the scheduled tasks screen, find the scheduled task (\core\task\legacy_plugin_cron_task) and click 'Run now'. Confirm the prompt. EXPECTED: The output should contain the text "Verifying self-enrolments..."

      I introduced a slight bug in MDL-59039 where the search cron tasks display progress using the existing core class, \text_progress_trace.

      This class just uses 'echo' whereas in cron you are supposed to use mtrace and there are some subtle differences. I'm not sure if these are actually evident as affecting users in standard Moodle, although it might, but it's still technically wrong (there are certain ways you could try to capture cron output where this won't work properly, which I've just discovered in deploying this in OU systems).

      I discussed it with Tim (who actually wrote text_progress_trace originally) and we think there should be an mtrace_progress_trace class for use in cron, so I'll make one.

       

            quen Sam Marshall
            quen Sam Marshall
            David Monllaó David Monllaó
            Damyon Wiese Damyon Wiese
            Damyon Wiese Damyon Wiese
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.