Skip to content
Snippets Groups Projects

Resolve #3408488 "Make unknownpathexcluder accept"

1 file
+ 5
8
Compare changes
  • Side-by-side
  • Inline
@@ -76,8 +76,6 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
return;
}
$project_root = $this->pathLocator->getProjectRoot();
// To determine the files to include, the installed packages must be known,
// and that requires Composer commands to be able to run. This intentionally
// does not catch exceptions: failed Composer validation in the project root
@@ -85,11 +83,12 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// Note: the call to ComposerInspector::getInstalledPackagesList() would
// also have triggered this, but explicitness is preferred here.
// @see \Drupal\package_manager\StatusCheckTrait::runStatusCheck()
$project_root = $this->pathLocator->getProjectRoot();
$this->composerInspector->validate($project_root);
// The vendor directory and web root are always included in staging
// operations, along with `composer.json`, `composer.lock`, and any files
// scaffold files provided by `drupal/core`.
// operations, along with `composer.json`, `composer.lock`, and any scaffold
// files provided by Drupal core.
$include = [
$this->composerInspector->getConfig('vendor-dir', $project_root),
$web_root,
@@ -129,10 +128,8 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
$project_root = $this->pathLocator->getProjectRoot();
$packages = $this->composerInspector->getInstalledPackagesList($project_root);
$extra = Json::decode($this->composerInspector->getConfig('extra', $packages['drupal/core']->path . '/composer.json'));
if (isset($extra['drupal-scaffold']['file-mapping'])) {
return array_keys($extra['drupal-scaffold']['file-mapping']);
}
return [];
return array_keys($extra['drupal-scaffold']['file-mapping'] ?? []);
}
}
Loading