mirror of
https://github.com/moodle/moodle.git
synced 2025-05-15 04:36:13 +02:00
MDL-77930 accesslib: php81 deprecation warnings on missing plugins
This commit is contained in:
parent
176a323b4e
commit
f6c5fa3bfc
@ -2646,7 +2646,7 @@ function get_capability_string($capabilityname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$dir = core_component::get_component_directory($component);
|
$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
|
// plugin broken or does not exist, do not bother with printing of debug message
|
||||||
return $capabilityname.' ???';
|
return $capabilityname.' ???';
|
||||||
}
|
}
|
||||||
@ -2670,7 +2670,7 @@ function get_component_string($component, $contextlevel) {
|
|||||||
|
|
||||||
list($type, $name) = core_component::normalize_component($component);
|
list($type, $name) = core_component::normalize_component($component);
|
||||||
$dir = core_component::get_plugin_directory($type, $name);
|
$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
|
// plugin not installed, bad luck, there is no way to find the name
|
||||||
return $component . ' ???';
|
return $component . ' ???';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user