You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the plugin to create an adhoc task to hide courses everything is working as expected. However, when using the plugin to change courses in a category to a state of "show", the plugin fails with an invalid function call to core_course\management\course_change_visibility() which is odd as this is failing on line 91 where it is calling the method from the helper class in the plugin code.
... started 02:05:06. Current memory use 49.7MB.
... used 3 dbqueries
... used 0.062679052352905 seconds
Adhoc task failed: tool_hidecourses\task\hide_courses_task,Call to undefined function core_course\management\course_change_visibility()
Backtrace:
* line 91 of /admin/tool/hidecourses/classes/task/hide_courses_task.php: call to core_course\management\helper::action_course_show()
* line 341 of /lib/cronlib.php: call to tool_hidecourses\task\hide_courses_task->execute()
* line 198 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
* line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks()
* line 178 of /admin/cli/cron.php: call to cron_run()
I've been able to recreate this in multiple Moodle 3.11.8 environments using version 3.6.0 of the plugin where the behavior is the same. Please let me know if you need other information.
The text was updated successfully, but these errors were encountered:
@inkjet2000 that's a strange error; I have a vague guess as to how it could happen. I've written another test that might give me more insight into what's going on.
I think this amounts to a core bug; I don't know why it doesn't fail consistently. course_change_visibility() isn't wrapped in a class; it lives in course/lib.php. core_course\management\helper::action_course_show(), which is namespaced, references the function without a backslash. I will follow up with Moodle core. On your environment, try replacing the reference to course_change_visibility in core_course\management\helper::action_course_show() with \course_change_visibility. You'll need to purge your cache after doing so.
When using the plugin to create an adhoc task to hide courses everything is working as expected. However, when using the plugin to change courses in a category to a state of "show", the plugin fails with an invalid function call to
core_course\management\course_change_visibility()
which is odd as this is failing on line 91 where it is calling the method from the helper class in the plugin code.I've been able to recreate this in multiple Moodle 3.11.8 environments using version 3.6.0 of the plugin where the behavior is the same. Please let me know if you need other information.
The text was updated successfully, but these errors were encountered: