- Issue created by @tormi
After upgrading to Flysystem 2.2.x, sites using remote stream wrappers (like S3) encounter fatal errors when Drupal tries to create temporary files:
Error: Call to undefined method Drupal\flysystem\FlysystemBridge::getDirectoryPath()This error occurs because Drupal's FileSystem::tempnam() method expects all stream wrappers to implement a getDirectoryPath() method, but this method was not included in the FlysystemBridge class. The error is triggered when:
s3://)getDirectoryPath() on the stream wrapperAlternatively, reproduce with Drush:
drush eval " \$wrapper = \Drupal::service('stream_wrapper_manager')->getViaUri('s3://test.jpg'); echo \$wrapper->getDirectoryPath(); "
Add the missing getDirectoryPath() method to the FlysystemBridge class. For remote streams, this method should return the system temporary directory path since remote streams don't have local directory paths.
Active
2.2
Code