Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
After upgrading from 4.1.5+ to 4.1.6, I got this error message when accessing "/admin/tool/task/scheduledtasks.php":
Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:
line 385 of /lib/classes/task/manager.php: Error thrown
line 530 of /lib/classes/task/manager.php: call to core\task\manager::scheduled_task_from_record()
line 105 of /admin/tool/task/scheduledtasks.php: call to core\task\manager::get_all_scheduled_tasks()
Ricardo
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
!!! Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time() !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 388 of \lib\classes\task\manager.php: Error thrown
* line 473 of \lib\classes\task\manager.php: call to core\task\manager::scheduled_task_from_record()
* line 123 of \admin\cli\scheduled_task.php: call to core\task\manager::get_scheduled_task()
!!
C:\inetpub\wwwroot\admin\cli>php scheduled_task.php --execute="\quiz_statistics\task\recalculate" --showsql
--------------------------------
SELECT * FROM mdl_task_scheduled WHERE classname = ?
[array (
0 => '\\quiz_statistics\\task\\recalculate',
)]
--------------------------------
Query took: 0.0030179023742676 seconds.
--------------------------------
!!! Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time() !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 388 of \lib\classes\task\manager.php: Error thrown
* line 473 of \lib\classes\task\manager.php: call to core\task\manager::scheduled_task_from_record()
* line 123 of \admin\cli\scheduled_task.php: call to core\task\manager::get_scheduled_task()
!!
C:\inetpub\wwwroot\admin\cli>php scheduled_task.php --execute="\quiz_statistics\task\recalculate" --showdebugging
!!! Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time() !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 388 of \lib\classes\task\manager.php: Error thrown
* line 473 of \lib\classes\task\manager.php: call to core\task\manager::scheduled_task_from_record()
* line 123 of \admin\cli\scheduled_task.php: call to core\task\manager::get_scheduled_task()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
It looks like the upgrade didn't complete successfully. In Moodle 4.2.3 and 4.1.6 there is no longer a quiz_statistics\task\recalculate scheduled task (MDL-79254) so Moodle shouldn't be attempting to run this. During the upgrade the mdl_task_scheduled record for this task should have been deleted.
Another possible explanation is the Moodle source code folder doesn't have the correct contents. Is the file mod/quiz/report/statistics/db/tasks.php present? It was present in 4.2.2 and 4.1.5 but should not be for 4.2.3 and 4.1.6.
You can probably fix this specific error by removing the record from the database (DELETE FROM mdl_task_scheduled WHERE classname = '\\quiz_statistics\\task\\recalculate'). But you may want to see if you can identify the cause of this because if one item was not upgraded correctly there may be others.
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Coding error detected, it must be fixed by a programmer: Unknown plugin type: core
Error code: codingerror
Error code: codingerror Stack trace:
- line 1668 of \lib\classes\plugin_manager.php: coding_exception thrown
- line 1019 of \lib\classes\plugin_manager.php: call to core_plugin_manager->is_plugintype_writable()
- line 1663 of \admin\renderer.php: call to core_plugin_manager->is_remote_plugin_installable()
- line 349 of \admin\renderer.php: call to core_admin_renderer->plugins_overview_panel()
- line 217 of \admin\plugins.php: call to core_admin_renderer->plugin_management_page()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
I can see where the upgrade disabled this task, which it had done, but not where it deletes it, can you confirm where this is in the upgrade files so I can check?
On upgrade Moodle checks the db/tasks.php for every plugin – including core plugins such as quiz_statistics here – and compares the listed tasks to those in mdl_task_scheduled. It adds records for new tasks, and removes the records if they no longer appear in tasks.php. So if mod/quiz/report/statistics/db/tasks.php was somehow still present when upgrading to 4.2.3 then the record won't have been deleted and the error you reported will occur.
I'm not sure about the Unknown plugin type: core but Francesco reports he resolved this.
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
hp
html
qedoc
hp
html
qedoc
analysis
clicktrail
overview
responses
scores
C:\inetpub\wwwroot\admin\cli>php uninstall_plugins.php --purge-missing --run
Can not be uninstalled: hp
Can not be uninstalled: html
Can not be uninstalled: qedoc
Can not be uninstalled: hp
Can not be uninstalled: html
Can not be uninstalled: qedoc
Can not be uninstalled: analysis
Can not be uninstalled: clicktrail
Can not be uninstalled: overview
Can not be uninstalled: responses
Can not be uninstalled: scores
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
https://moodle.org/plugins/mod_hotpot/versions
select plugin from mdl_config_plugins where plugin like 'hotpot%';
Not sure about the 'like' in above ... am guessing that is what it would register.
Then you'd have to find all related tables in DB and remove those.
in /mod/hotpot/db there should be an install.xml file as well as an uninstall.php script.
Taking a peak at those might provide more info on how to eradicate.
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
MDL-79627 is not a bug in Moodle. The upgrade was performed incorrectly with one of the previous version's source files still present resulting in the Call to undefined method quiz_statistics\task\recalculate::set_minute() error. As the docs say:
Do NOT copy new files over the old files.
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
After deleting the file mod/quiz/report/statistics/db/tasks.php, and the line in mdl_task_scheduled table ( WHERE component='quiz_statistics'), as explained, everything was OK, as explained in my comments in MDL-79627.
Hope this helps other people having made the update the same way as me.
Séverin
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Même problème après mise à jour en 4.2.3 +
J'ai suivi à la lettre la procédure décrite, et cela a effectivement résolu le problème.
Merci pour ces explications
Didier
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
My client no longer wants to use Moodle, says you get what you pay for. Prior to this upgrade my sites were paralyzed because of a bug that impacted Articulate Storyline courses. Tired of spending hours debugging these types of problems.
Past few updates have been nothing but problems.
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Looks like the upgrade fixed the “{“ issue. I was able to correct the other issue by using:
DELETE FROM mdl_task_scheduled WHERE classname = '\\quiz_statistics\\task\\recalculate'
I have not updated my two large production sites yet I am away and doing this on a phone Next week I will try and see what happens
I am also taking your advise and not updating Moodle for some time after this Turns out to be nothing but headaches every time
Thank you for all the help
Bob
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
Re: Exception - Call to undefined method quiz_statistics\task\recalculate::set_last_run_time()
On "all must choose our paths and methods", tell me the one which is closer to heaven?