bdaloukas / moodle-mod_game

moodle-mod_game
GNU General Public License v3.0
15 stars 40 forks source link

get_shortcuts now deprecated #44

Open jwalits opened 2 years ago

jwalits commented 2 years ago

Hi,

Whilst running the unit tests in Moodle 3.9, we came across a lot of unit test failures. Example:

1) tests\core_course\caching_content_item_readonly_repository_testcase::test_find_all_for_course
Unexpected debugging() call detected.
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.

We have traced the issue down to the use of get_shortcuts method here: https://github.com/bdaloukas/moodle-mod_game/blob/MOODLE_20_STABLE/lib.php#L1062

As per the upgrade.txt of Moodle 3.9, this method has now been marked as deprecated: https://github.com/moodle/moodle/blob/e746dc75af1f537e56b366b6368ae3f33482687f/mod/upgrade.txt#L7-L10