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:
Eloy Lafuente (stronk7)
2023-02-28 11:34:21 +01:00
parent 9ee4f8db8b
commit d2c721b9e0
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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));
}