Commit 520add19 authored by Jake Dallimore's avatar Jake Dallimore
Browse files

MDL-67585 core_course: deprecate the callback get_shortcuts()

This involves a few changes:
- The callback is still called by the repository but only if the
replacement callback get_course_content_items is not implemented.
- Debugging is called when the get_shortcuts callback is called.
- We leave lti's implementation of get_shortcuts alone, in order to
maintain the output of get_module_metadata during its deprecation life
span.
parent 39b9e293
......@@ -213,6 +213,11 @@ class content_item_readonly_repository implements content_item_readonly_reposito
}
} else if (component_callback_exists('mod_' . $mod->name, 'get_shortcuts')) {
// TODO: MDL-68011 this block needs to be removed in 4.3.
debugging('The callback get_shortcuts has been deprecated. Please use get_course_content_items and
get_all_content_items instead. Some features of the activity chooser, such as favourites and recommendations
are not supported when providing content items via the deprecated callback.');
// If get_shortcuts() callback is defined, the default module action is not added.
// It is a responsibility of the callback to add it to the return value unless it is not needed.
// The legacy hook, get_shortcuts, expects a stdClass representation of the core module content_item entry.
......
......@@ -208,6 +208,8 @@ function lti_delete_instance($id) {
* Return aliases of this activity. LTI should have an alias for each configured tool type
* This is so you can add an external tool types directly to the activity chooser
*
* @deprecated since 3.9
* @todo MDL-68011 This is to be moved from here to deprecatedlib.php in Moodle 4.3
* @param stdClass $defaultitem default item that would be added to the activity chooser if this callback was not present.
* It has properties: archetype, name, title, help, icon, link
* @return array An array of aliases for this activity. Each element is an object with same list of properties as $defaultitem,
......
This files describes API changes in /mod/lti/source/* - LTI source plugins,
information provided here is intended especially for developers.
=== 3.9 ===
* The callback get_shortcuts() is now deprecated. Please use get_course_content_items and get_all_content_items instead.
See source code examples in get_course_content_items() and get_all_content_items() in mod/lti/lib.php for details.
=== 3.1 ===
* Callback get_types() is deprecated, instead ltisource plugins can define callback get_shortcuts().
......
This files describes API changes in /mod/* - activity modules,
information provided here is intended especially for developers.
=== 3.9 ===
* The callback get_shortcuts() is now deprecated. Please use get_course_content_items and get_all_content_items instead.
See source code examples in get_course_content_items() and get_all_content_items() in mod/lti/lib.php for details.
=== 3.8 ===
* The final deprecation of xxx_print_overview() callback means that this function will no longer be called.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment