MDL-77930 accesslib: php81 deprecation warnings on missing plugins

This commit is contained in:
Rajneel Totaram 2023-04-16 19:59:53 +12:00
parent 176a323b4e
commit f6c5fa3bfc

View File

@ -2646,7 +2646,7 @@ function get_capability_string($capabilityname) {
}
$dir = core_component::get_component_directory($component);
if (!file_exists($dir)) {
if (!isset($dir) || !file_exists($dir)) {
// plugin broken or does not exist, do not bother with printing of debug message
return $capabilityname.' ???';
}
@ -2670,7 +2670,7 @@ function get_component_string($component, $contextlevel) {
list($type, $name) = core_component::normalize_component($component);
$dir = core_component::get_plugin_directory($type, $name);
if (!file_exists($dir)) {
if (!isset($dir) || !file_exists($dir)) {
// plugin not installed, bad luck, there is no way to find the name
return $component . ' ???';
}