The very nice folk from my institution’s ICT group warned me back in March that
I have started work on the moodle 2.6 upgrade that will be happening midyear and have come across some deprecation warning from BIM. Just giving you plenty of notice that an updated version will be needed before release.
That was just as my first use of BIM on the institution’s servers was getting underway. That’s gone reasonably well and it will be continuing (and hopefully expanding as I learn more about what’s required and possible with the approach) next semester, so I better get BIM playing nicely with 2.6. That’s what this post is reporting on.
Get Moodle 2.6 running
Let’s get the latest version of Moodle 2.6 – 2.6.3 – and install that.
So that’s the first change. PHP setting for caching. Not that I’ll need that for testing. Looks like I can ignore it for now.
Get BIM installed
I’m doing this so irregularly now it’s good that I actually documented this last time.
That all appears to be working. Ahh, but I haven’t turned the debugging all the way up to annoying yet.
get_context_instance() is deprecated, please use context_xxxx::instance() instead.
And about this stage it was always going to be time to….
Check the Moodle 2.6 release notes
The Moodle 2.6 release notes and then the developer notes. Nothing particularly related to this warning.
Do it manually
As outlined in this message it appears that this particular usage has been deprecated for a few versions. The deprecatedlib.php suggests this gets removed in 2.8.
So the changes I’m doing appear like this
#$context = get_context_instance( CONTEXT_COURSE, $course->id ); $context = context_course::instance( $course->id );
I can see this is needed in the following
- ./index.php **done?**
./view.php– this one had actually been done earlier
#$context = get_context_instance( CONTEXT_MODULE, $cm->id );
$context = context_module::instance( $cm->id );
That all seems to be working.
Do a big test
Will back up a large BIM activity with a temp course from my Moodle 2.5 instance and restore it under Moodle 2.6.
Some more issues
print_container() is deprecated. Please use $OUTPUT->container() instead. Done