diff --git a/src/Commands/core/ArchiveDumpCommands.php b/src/Commands/core/ArchiveDumpCommands.php index 1567cb67e5..7f9cc2613b 100644 --- a/src/Commands/core/ArchiveDumpCommands.php +++ b/src/Commands/core/ArchiveDumpCommands.php @@ -5,6 +5,7 @@ namespace Drush\Commands\core; use Drupal; +use Drupal\Core\StreamWrapper\PublicStream; use Drush\Attributes as CLI; use Drush\Boot\DrupalBootLevels; use Drush\Commands\DrushCommands; @@ -381,6 +382,10 @@ private function getCodeComponentPath(array $options): string $process->mustRun(); $composerInfoRaw = $process->getOutput(); $installedPackages = json_decode($composerInfoRaw, true)['installed'] ?? []; + // Remove path projects ('source' is empty for path projects) + $installedPackages = array_filter($installedPackages, function ($dependency) { + return !empty($dependency['source']); + }); $installedPackagesPaths = array_filter(array_column($installedPackages, 'path')); $installedPackagesRelativePaths = array_map( fn($path) => ltrim(str_replace([$this->getComposerRoot()], '', $path), '/'), @@ -451,8 +456,7 @@ private function getDrupalFilesComponentPath(): string } /** - * Returns the path to Drupal files directory. - * + * Returns the full path to Drupal files directory. * * @throws \Exception */ @@ -463,7 +467,7 @@ private function getDrupalFilesDir(): string } Drush::bootstrapManager()->doBootstrap(DrupalBootLevels::FULL); - $drupalFilesPath = Drupal::service('file_system')->realpath('public://'); + $drupalFilesPath = Path::join($this->getRoot(), PublicStream::basePath()); if (!$drupalFilesPath) { throw new Exception(dt('Path to Drupal files is empty.')); }