- Issue created by @natts
- πΊπΈUnited States smustgrave
Can you check your file permissions on vendor folder? Symfony\Component\Filesystem has been around from what I can tell in Drupal core for some time.
- π¬π§United Kingdom natts London
It wasn't a permissions issue on the root vendor directory.
A version of the Filesystem class is indeed in core, but the PrivateFiles.php check in this module wants to use the Symfony version:
<?php namespace Drupal\security_review\Checks; use Drupal\Core\Link; use Drupal\Core\StreamWrapper\PrivateStream; use Drupal\security_review\Check; use Drupal\security_review\CheckResult; use Symfony\Component\Filesystem\Filesystem; /** * Checks whether the private files' directory is under the web root. */ class PrivateFiles extends Check { ...
So as a workaround, I had to require the component in Composer ('composer require symfony/filesystem') to get that specific version of the class into my codebase.
If the check should be using the Drupal core version, not the Symfony version that is stated, then I would think that last use line of PrivateFiles.php needs updating to:
use Drupal/Core/Component/Filesystem/Filesystem;
- @smustgrave opened merge request.
- Status changed to Needs review
almost 2 years ago 3:42pm 4 February 2023 - π¬π§United Kingdom natts London
I wasn't the author of the Private Files check, so I don't know which is the correct version of the Filesystem class to be used by it.
-
smustgrave β
committed 4cec3a60 on 2.0.x
Issue #3337726: Error: Class "Symfony\Component\Filesystem\Filesystem"...
-
smustgrave β
committed 4cec3a60 on 2.0.x
- Status changed to Fixed
almost 2 years ago 7:27pm 5 February 2023 - πΊπΈUnited States smustgrave
This should ensure symfony is installed.
Automatically closed - issue fixed for 2 weeks with no activity.
- π©πͺGermany richardmetzger
Just installed this module and ran across the reported error.
composer require symfony/filesystem
solved it for me.