Skip to content
Snippets Groups Projects
Commit 10c0945e authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3424290 by abhishek_gupta1: Error in CollectPathsToExcludeEvent.php ->...

Issue #3424290 by abhishek_gupta1: Error in CollectPathsToExcludeEvent.php -> must be string, bool given
parent 917d77d7
No related branches found
No related tags found
1 merge request!1026Issue #3424290 check if file settings path exist
Pipeline #116212 failed
......@@ -59,7 +59,9 @@ final class SiteFilesExcluder implements EventSubscriberInterface {
$path = $wrapper->getDirectoryPath();
if ($this->fileSystem->isAbsolutePath($path)) {
$event->addPathsRelativeToProjectRoot([realpath($path)]);
if ($path = realpath($path)) {
$event->addPathsRelativeToProjectRoot([$path]);
}
}
else {
$event->addPathsRelativeToWebRoot([$path]);
......
......@@ -55,4 +55,18 @@ class SiteFilesExcluderTest extends PackageManagerKernelTestBase {
}
}
/**
* Tests that invalid file settings do not cause errors.
*/
public function testInvalidFileSettings() {
$invalid_path = '/path/does/not/exist';
$this->assertFileDoesNotExist($invalid_path);
$this->setSetting('file_public_path', $invalid_path);
$this->setSetting('file_private_path', $invalid_path);
// Ensure we have an up-to-date container.
$this->container = $this->container->get('kernel')->rebuildContainer();
$this->assertStatusCheckResults([]);
$this->assertResults([]);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment