From 76fac075abeb70e61fefd41bf37898245dd76913 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 11 May 2023 11:39:27 +1000 Subject: [PATCH] [REF] Skip checking vendor provided orphened files if the vendor directory is not within the CiviCRM root --- CRM/Utils/Check/Component/Source.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Check/Component/Source.php b/CRM/Utils/Check/Component/Source.php index 9ab53711f7..db16046422 100644 --- a/CRM/Utils/Check/Component/Source.php +++ b/CRM/Utils/Check/Component/Source.php @@ -68,7 +68,7 @@ class CRM_Utils_Check_Component_Source extends CRM_Utils_Check_Component { */ public function findOrphanedFiles() { $orphans = []; - + $core_supplied_vendor = Civi::paths()->getPath('[civicrm.root]/vendor'); foreach ($this->getRemovedFiles() as $file) { $path = Civi::paths()->getPath($file); if (empty($path) || strpos('[civicrm', $path) !== FALSE) { @@ -77,6 +77,10 @@ class CRM_Utils_Check_Component_Source extends CRM_Utils_Check_Component { 'path' => $path, ]); } + // If Vendor directory is not within the civicrm module directory (Drupal 8/9/10) etc ignore checks on the vendor paths. + if (strpos($file, '.vendor') !== FALSE && !is_dir($core_supplied_vendor)) { + continue; + } if (file_exists($path)) { $orphans[] = [ 'name' => $file, -- 2.25.1