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

Issue fork advagg-3201922

Command icon 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

cmlara created an issue. See original summary.

tbadaczewski’s picture

We are having the same issues on our project.

guillaumeg’s picture

Same 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.

cmlara’s picture

Status: Active » Reviewed & tested by the community

Looks good to me.

sandeepguntaka made their first commit to this issue’s fork.

thalles’s picture

Looks good!
Make sense to me!

thalles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.