Merge branch 'MDL-77930-401' of https://github.com/rjnl/moodle into MOODLE_401_STABLE

This commit is contained in:
Jake Dallimore 2023-05-16 10:50:04 +08:00
commit 071adb2fb1
No known key found for this signature in database

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 . ' ???';
}