Exception - Call to a member function get_minute() - Moodle 3.9 (Build: 20200615)

Exception - Call to a member function get_minute() - Moodle 3.9 (Build: 20200615)

by Dave Emsley -
Number of replies: 2

Hi all,

I'm getting the message:

Exception - Call to a member function get_minute() on bool
More information about this error
Debug info:  
Error code: generalexceptionmessage  
Stack trace: 

  • line 135 of /admin/tool/task/renderer.php: Error thrown
  • line 99 of /admin/tool/task/scheduledtasks.php: call to tool_task_renderer->scheduled_tasks_table()
and I'm unsure how to deal with it.  Any advice gratefully received.

Cheers

Dave
Average of ratings: -
In reply to Dave Emsley

Re: Exception - Call to a member function get_minute() - Moodle 3.9 (Build: 20200615)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

From a read of the source code it looks like this error could happen if a scheduled task was missing the corresponding row in mdl_task_scheduled in the database.

If this error happens when you're trying to run or access a specific task, you could use this query, e.g. to check task \logstore_standard\task\cleanup_task:

SELECT * FROM mdl_task_scheduled WHERE classname = '\\logstore_standard\\task\\cleanup_task';

(Double-backslashes required in MySQL/MariaDB).

If the error occurs when the affected task isn't obvious, e.g. on the Scheduled task page, you might need to modify the source code to get the affected task reported. You could modify admin/tool/task/renderer.php adding line 82 below to send the task's class name to the web server error log:

 79         foreach ($tasks as $task) {
 80             $classname = get_class($task);
 81             $defaulttask = \core\task\manager::get_default_scheduled_task($classname, false);
 82             if (!$defaulttask) error_log("Task: $classname");
Average of ratings: Useful (3)
In reply to Leon Stringer

Re: Exception - Call to a member function get_minute() - Moodle 3.9 (Build: 20200615)

by Dave Emsley -
Thanks again Leon,

Cheers
Dave