From f74f702c88cfbb1d67c6c3c022e2d32a33f5c129 Mon Sep 17 00:00:00 2001 From: Rajneel Totaram Date: Thu, 20 Apr 2023 19:44:17 +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 1000d93aa94..e999455c13d 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2699,7 +2699,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.' ???'; } @@ -2723,7 +2723,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 . ' ???'; }