Closed thepurpleblob closed 5 years ago
Further... I can't see any reason to have a version check on this page at all. Moodle already has a facility to show new versions of plugins.
Sorry for the slow reply, our normal bug report process doesn't use github so this isn't monitored.
@thepurpleblob the version check is testing the version of Medial you have is compatible with the plugin version that you have installed, it isn't checking for upgrades to the Moodle plugin itself, this still happens as part of the normal Moodle plugin update code.
Re the notice, the issue is that in some contexts Moodle is setting the page URL prior to calling this code, in others it doesn't hence the error. It's not the page URL I'm after here, I just want to suppress the version check (which involves an API call to MEDIAL so is quite slow) from being performed unless you're actually on the MEDIAL settings page, so I'll re-write this to use $PAGE->pagetype which is automatically set so should always be present and will tell me what I need to know in a cleaner way (qualified_me would require the code to parse the URL to work that out). That will be in the next plugin release when it goes through QA, the code change will look like this if you want to manually patch your version in the interim:
if ($PAGE->pagetype=="admin-setting-modsettinghelixmedia") { require_once($CFG->dirroot.'/mod/helixmedia/locallib.php'); $settings->add(new admin_setting_heading('helixmedia/version_check', get_string("version_check_title", "mod_helixmedia"), helixmedia_version_check())); }
I'll trim out the superfluous global $CFG at the same time, as you say that's not actually needed.
This bit of code in settings.php
throws the following notice with Developer debugging enabled...
It appears that the expected url has not been set prior to settings.php being called.