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:41:04 +01:00
parent a31f5830bd
commit be32856374
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));
}