-
Bug
-
Resolution: Fixed
-
Blocker
-
3.3.5, 3.4.2, 3.5
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
-
MOODLE_33_STABLE, MOODLE_34_STABLE
-
MDL-61800-master -
I noticed when writing a new an adhoc task runner that we do not setup the OUTPUT API properly between runs.
At the moment, adhoc tasks (and probably scheduled tasks too) only have working output by virtue of other tasks setting up the adhoc task.
- Install the attached local plugin
- Run php local/adhoctest/prepare.php to queue an adhoc task
- Run php local/adhoctest/runadhoc.php
The task should dump an action_link which has been rendered using a template and renderer.
The runadhoc.php script is just a copy of admin/cli/cron.php and cronlib.php::cron_run() with the scheduled tasks part removed. No other changes have been made.
However, the code does not set up any $OUTPUT, but somewhere along the line if I run the standard cron runner then OUTPUT is set up and this i used instead.
I can replicate the same issue if I run:
php admin/cli/cron.php ; php local/adhoctest/prepare.php ; php admin/cli/cron.php
|
Note: You may have to run this a few times.