remotelearner/moodle-local_mymedia — pull request #1 by SMERKY (2014-04-15 20:53:48+00:00)
Title: Update lib.php

When installed in a Moodle instance newer than 2.2, the following error is thrown;

get_context_instance() is deprecated, please use context_xxxx::instance() instead.

This code change will stop this error being thrown, using the new function as requested by the error. I have placed the isLoggedIn() check to bypass another error that is thrown when trying to access this new function without being logged in. When you are not logged in, you have a user id of '0' and when passing this to the new function, it calls a Moodle Coding Error and wot display a page.