From 235e322db6bee7e3fc145322d73aa43b3c94e5c7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 15 Sep 2019 14:12:52 -0400 Subject: [PATCH] api4 - Fix computation of core path The `$locations` array mostly contains the paths of *extension PHP files*, and the subsequent code filters with`dirname()` to strip them out. Before: The path `/var/www/sites/all/modules/civicrm` was digested to `/var/www/sites/all/modules/Civi/Api4/Subscribers`. After: The path `/var/www/sites/all/modules/civicrm/Civi.php` is digested `/var/www/sites/all/modules/civicrm/Civi/Api4/Subscribers`. --- CRM/Api4/Services.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Api4/Services.php b/CRM/Api4/Services.php index 0e78e1a931..a615f1a0e2 100644 --- a/CRM/Api4/Services.php +++ b/CRM/Api4/Services.php @@ -57,7 +57,7 @@ class CRM_Api4_Services { */ public static function loadServices($namespace, $tag, $container) { $namespace = \CRM_Utils_File::addTrailingSlash($namespace, '\\'); - $locations = array_merge([\Civi::paths()->getPath('[civicrm.root]/.')], + $locations = array_merge([\Civi::paths()->getPath('[civicrm.root]/Civi.php')], array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'filePath') ); foreach ($locations as $location) { -- 2.25.1