MDL-77430 plugininfo: php81 deprecation warnings on missing plugins
Whenever some plugin is missing from disk but installed, the plugins page (and the upgrade) shows them as "missing from disk". Still, the code tries to do things with their directory that, now, is null. That was silently defaulting to '' in previous php versions, but php81 emits a deprecated warning. So we have to check for them.
This commit is contained in:
@@ -598,6 +598,10 @@ abstract class base {
|
||||
public function get_dir() {
|
||||
global $CFG;
|
||||
|
||||
if (!isset($pluginfo->rootdir)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return substr($this->rootdir, strlen($CFG->dirroot));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user