Problem/Motivation
Doing some work over in S3FS I managed to hit a bug that prevents drush from executing.
Executing Drush commands with a decorated filesystem service causes the following error:
TypeError: Argument 3 passed to Drupal\advagg\Commands\AdvaggCommands::__construct() must be an instance of Drupal\Core\File\FileSystem, instance of Drupal\s3fs\S3fsFileService given,
The 'Drupal\s3fs\S3fsFileService' is due to the fact that over in S3FS we now decorate the file_system service to allow us to verify that data was flushed to the remote location and raise an error when not. This would impact any system with a decorated file_system service
Steps to reproduce
Decorate the file_system service (rebuild the cache), call drush help and observe the error occurs.
Proposed resolution
Change typehint to FileSystemInterface instead of FileSystem in src/Commands/AdvaggCommands.php
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fix-issue-with-advagg-and-s3fs-modules-3201922-3.patch | 1.53 KB | guillaumeg |
Issue fork advagg-3201922
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tbadaczewski commentedWe are having the same issues on our project.
Comment #3
guillaumeg commentedSame issue here, the proposed solution (Change typehint to FileSystemInterface instead of FileSystem in src/Commands/AdvaggCommands.php) fixes the issue.
Providing the corresponding patch in attachement.
Comment #4
cmlaraLooks good to me.
Comment #7
thallesLooks good!
Make sense to me!
Comment #9
thallesThanks @all!