From f6c5fa3bfca1d430697a8c5390e5bb27814ea5db Mon Sep 17 00:00:00 2001 From: Rajneel Totaram Date: Sun, 16 Apr 2023 19:59:53 +1200 Subject: [PATCH] MDL-77930 accesslib: php81 deprecation warnings on missing plugins --- lib/accesslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/accesslib.php b/lib/accesslib.php index cacfc2f16bc..fbb7d48c89b 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -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 . ' ???'; }