- Issue created by @osopolar
Yesterday i updated the module on an installation where we are also using S3 Module β :
drupal/consumer_image_styles (4.0.8 => 4.0.10)
After the upgrade i get
Error: Call to a member function getType() on false in Drupal\consumer_image_styles\ImageStylesProvider->buildDerivativeLink() (line 128 of /var/www/html/htdocs/modules/contrib/consumer_image_styles/src/ImageStylesProvider.php
i tried the patch from MR #27 , but still got the error.
Problem seems that
$this->streamWrapperManager->getViaScheme(StreamWrapperManager::getScheme($uri)
returnsfalse
now.- π©πͺGermany osopolar π©πͺ GER π
@makkus183 Can you (x)debug and check why it returns false? Which StreamWrapper do you use? I assume it's a different issue. This one is about figuring out if it's a local file or not. In your case it's about wrong behavior of
$this->streamWrapperManager->getViaScheme(StreamWrapperManager::getScheme($uri)
, which of cause will make the detection fail but for different reasons. May you open a new issue and also link it here? - πΊπΈUnited States tom friedhof
I can confirm the issue posted in #6. Reverting back to 4.0.8 resolves the issue that @makkus183 brought up.
It's because `StreamWrapperManager::getScheme($uri)` returns empty when processing the `/no-thumbnail.png` file that I believe comes from the Media module.
@osopolar i did some (x)debugging and found the reason. We applied a patch which solved a validation error in JSON:API if an image name has a space in the filename. (see uri-reference in
vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php
)This patch urlencoded the $uri which caused theStreamWrapperManager::getScheme($uri)
to returnfalse
as mentioned. I removed the patch and it is working as expected. The error which occured when a filename contains a space does not appear anymoree either.
So you were right, it was another issue in my case.