- Issue created by @project update bot
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → these changes make this module compatible with Drupal 11! 🎉
Therefore these changes update theinfo.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug info
Bot run #11-121090This patch was created using these packages:
- drupal/upgrade_status: 4.1.0
- mglaman/phpstan-drupal: 1.2.7
- palantirnet/drupal-rector: 0.20.1
- First commit to issue fork.
- 🇺🇸United States BenStallings
I'm unable to install this fork in D11 with composer due to its dependency on flysystem v2 which is not D11 compatible. It needs to be dependent on version 3, or at least this MR: https://git.drupalcode.org/issue/flysystem-3451092/-/tree/fix-merge-error
- 🇮🇳India shashi_shekhar_18oct
MR!21 Makes this module compatible with Drupal 11. Functionality is working as expected.
RTBC +1
- 🇺🇸United States BenStallings
@shashi_shekhar_18oct as I said above, the dependency on version 2.0 of flysystem module, which does not support Drupal 11, means that this version of flysystem_s3 cannot be installed with composer into a Drupal 11 site. This module needs to be made dependent on a version of flysystem that supports D11.
This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.
It is important that any automated tests available are run and that you manually test the changes.
Drupal 11 Compatibility
According to the Upgrade Status module → these changes make this module compatible with Drupal 11! 🎉
Therefore these changes update theinfo.yml
file for Drupal 11 compatibility.Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot → to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.
Debug information
Bot run #11-392907These packages were used to generate the fixes:
- drupal/upgrade_status: 4.3.6
- mglaman/phpstan-drupal: 1.3.2
- palantirnet/drupal-rector: 0.20.3
- 🇺🇸United States BenStallings
Looking at https://www.drupal.org/project/flysystem/issues/3378738 🌱 Planning for Release 3.0.0, Drupal 10.3+ Compatibility, Flysystem v3.1 Compatibility Needs work , it looks like there's no chance Flysystem v3 will be ready anytime soon, so I drop my objection. I'll see if I can make this work with the 2.2.x-dev MR at https://www.drupal.org/project/flysystem/issues/3433330 📌 Automated Drupal 11 compatibility fixes for flysystem Needs review .
- 🇺🇸United States BenStallings
I can confirm that MR!21 can now be installed with composer and enabled in Drupal 11.
- Status changed to RTBC
3 months ago 8:04pm 6 March 2025 - 🇳🇿New Zealand Gold 20 minutes in the future
Hey all,
Any chance of getting this merged in and a release?
Cheers.
- 🇺🇸United States BenStallings
I'm now seeing,
Call to deprecated method generateImageStyle() of class Drupal\flysystem_s3\Flysystem\S3. Deprecated in flysystem:2.2.0 and is removed from flysystem:3.0.0. Adapters should use generateImageUrl() to enable non-blocking image uploads.
on line 227 of S3.php. I'll see if I can fix it.
- 🇺🇸United States w01f
Following up on this. I'm looking to try and use flysystem for S3 in a new D11 project and avoiding drupal-lenient unless absolutely necessary =).
- 🇬🇧United Kingdom Eli-T Manchester
On second thoughts, using 2.1.x for D10 and 2.2.x for D11 prevents us from ever having another D10 minor release, which is something we may possibly want to do. So let's use 3.0.x for D11.
- 🇬🇧United Kingdom Eli-T Manchester
I've tried to push this along as far as I can today.
The only issue I'm currently aware of stopping this being merged and having a D11 release is that the PHPUnit job in CI is currently failing.
For example https://git.drupalcode.org/project/flysystem_s3/-/jobs/5464727
All the tests themselves pass, so I presume the job failing is due to the deprecations. I can't see the specifics of those in CI, but running locally I can see
❰elliot.ward❙~/code/d11test/d11/web/modules/contrib/flysystem_s3(git:3430648-d11_ready)❱✔≻ ddev exec phpunit -c web/core/phpunit.xml.dist web/modules/contrib/flysystem_s3 HTML output directory sites/simpletest/browser_output is not a writable directory. PHPUnit 10.5.36 by Sebastian Bergmann and contributors. Runtime: PHP 8.3.21 Configuration: /var/www/html/web/core/phpunit.xml.dist DD.D...... 10 / 10 (100%) Time: 00:02.496, Memory: 20.00 MB 3 tests triggered 5 deprecations: 1) /var/www/html/vendor/symfony/error-handler/DebugClassLoader.php:341 Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\flysystem\ImageStyleCopier" now to avoid errors or add an explicit @return annotation to suppress this message. Triggered by: * Drupal\Tests\flysystem_s3\Functional\ModuleInstallUninstallWebTest::testInstallationAndUninstallation /var/www/html/web/modules/contrib/flysystem/tests/src/Functional/ModuleInstallUninstallWebTest.php:27 2) /var/www/html/vendor/symfony/error-handler/DebugClassLoader.php:341 Method "Aws\CacheInterface::get()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Drupal\flysystem_s3\AwsCacheAdapter" now to avoid errors or add an explicit @return annotation to suppress this message. Triggered by: * Drupal\Tests\flysystem_s3\Unit\AwsCacheAdapterTest::testBasicGetSetDelete /var/www/html/web/modules/contrib/flysystem_s3/tests/src/Unit/AwsCacheAdapterTest.php:20 3) /var/www/html/vendor/symfony/error-handler/DebugClassLoader.php:341 Method "League\Flysystem\AwsS3v3\AwsS3Adapter::has()" might add "bool" as a native return type declaration in the future. Do the same in child class "Drupal\flysystem_s3\Flysystem\Adapter\S3Adapter" now to avoid errors or add an explicit @return annotation to suppress this message. Triggered by: * Drupal\Tests\flysystem_s3\Unit\Flysystem\S3Test::testGetExternalUrl /var/www/html/web/modules/contrib/flysystem_s3/tests/src/Unit/Flysystem/S3Test.php:61 4) /var/www/html/vendor/symfony/error-handler/DebugClassLoader.php:341 Method "League\Flysystem\AwsS3v3\AwsS3Adapter::getMetadata()" might add "false|array" as a native return type declaration in the future. Do the same in child class "Drupal\flysystem_s3\Flysystem\Adapter\S3Adapter" now to avoid errors or add an explicit @return annotation to suppress this message. Triggered by: * Drupal\Tests\flysystem_s3\Unit\Flysystem\S3Test::testGetExternalUrl /var/www/html/web/modules/contrib/flysystem_s3/tests/src/Unit/Flysystem/S3Test.php:61 5) /var/www/html/vendor/symfony/error-handler/DebugClassLoader.php:341 Method "League\Flysystem\AwsS3v3\AwsS3Adapter::upload()" might add "array|bool" as a native return type declaration in the future. Do the same in child class "Drupal\flysystem_s3\Flysystem\Adapter\S3Adapter" now to avoid errors or add an explicit @return annotation to suppress this message. Triggered by: * Drupal\Tests\flysystem_s3\Unit\Flysystem\S3Test::testGetExternalUrl /var/www/html/web/modules/contrib/flysystem_s3/tests/src/Unit/Flysystem/S3Test.php:61 OK, but there were issues! Tests: 10, Assertions: 27, Deprecations: 5.
These deprecations do not seem to be raised on D10 / flysystem_s3 2.1.x / phpunit 9.
I probably won't get time to look at this again in the nearish future, so if anyone is requiring a D11 release, the best thing you can do to move this issue forward is to look at why PHPunit is failing in CI.
- 🇺🇸United States w01f
Here's a pass at a patch for the 2 deprecation issues I see in flysystem_s3, for AwsCacheAdapter.php and S3Adapter.php - the remaining deprecation for the ImageStyleCopier.php file in the core flysystem module.
- 🇺🇸United States BenStallings
When I run phpunit on my local, it complains about a bunch of missing composer dependencies. One at a time, of course. If I require each of them, I eventually get
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\Tests\flysystem_s3\Unit\Flysystem\S3Test::__construct(), 0 passed in /var/www/html/vendor/phpunit/phpunit/src/Framework/TestBuilder.php on line 138 and exactly 1 expected in /var/www/html/web/modules/composer/flysystem_s3/tests/src/Unit/Flysystem/S3Test.php:48
- 🇺🇸United States BenStallings
Now I'm getting,
1) Drupal\Tests\flysystem_s3\Unit\AwsCacheAdapterTest::testBasicGetSetDelete
Failed asserting that false is null. - 🇺🇸United States w01f
Swapping false for null should resolve that, ensuring AwsCacheAdapter::get() returns null (instead of false) when an item is not found. This should make the “assert null on a cache‐miss” pass again.
--- a/src/AwsCacheAdapter.php
+++ b/src/AwsCacheAdapter.php
@@ -38,7 +38,7 @@ class AwsCacheAdapter implements CacheInterface {
public function get(string $key): mixed {
if ($item = $this->cache->get($this->prefix . $key)) {
return $item->data;
}
- return false;
+ return null;
}public function set(string $key, mixed $value): void {