From 8bf27bec42a1b970cea7ee9759e9897e55283642 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 13 Oct 2022 02:17:47 +0000 Subject: [PATCH] [REF][PHP8.1] Fix Extension Manager Module test failures on php8.1 due to passing in null to dirname --- Civi/Api4/Service/LegacySpecScanner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Api4/Service/LegacySpecScanner.php b/Civi/Api4/Service/LegacySpecScanner.php index 55c352e2e9..fcbe35e8f0 100644 --- a/Civi/Api4/Service/LegacySpecScanner.php +++ b/Civi/Api4/Service/LegacySpecScanner.php @@ -53,7 +53,7 @@ class LegacySpecScanner implements AutoServiceInterface { array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'filePath') ); foreach ($locations as $location) { - $path = \CRM_Utils_File::addTrailingSlash(dirname($location)) . str_replace('\\', DIRECTORY_SEPARATOR, $namespace); + $path = \CRM_Utils_File::addTrailingSlash(dirname($location ?? '')) . str_replace('\\', DIRECTORY_SEPARATOR, $namespace); if (!file_exists($path) || !is_dir($path)) { $resource = new \Symfony\Component\Config\Resource\FileExistenceResource($path); $container->addResource($resource); -- 2.25.1