New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix linking to invariable image URLs #10342
Fix linking to invariable image URLs #10342
Conversation
@ahukkanen I do not have enough informations for testing scenario. All the changes ere tested for replication on develop brach, using ruby 3.1.2 |
I have tried with the following image magick versions: Setting up imagemagick (8:6.9.11.60+dfsg-1.3+deb11u1) ...
|
@alecslupu Sorry, I have mistakenly written the configuration instructions for this. I have just corrected it. You need to set the Rails will actually override the initializer configuration with the value set in the environment configuration. Here is a screencap how I can replicate this issue at decidim-invariable-error.mp4And when running under this branch I don't get that error anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still could not replicate the upload problem, yet, i could see the ActiveStorage::InvariableError
on the homepage using latest develop branch. It dissapeared one the patch was applied.
Any chance to see this backported to v0.26 ? :) |
馃帺 What? Why?
Not all environments support creating "variable URLs" for all image types. Let's say the admin user would allow uploading image files that cannot be converted using ImageMagick.
In this case, the file conversion fails because of an exception of type
ActiveStorage::InvariableError
is thrown.How the user would see this is that they cannot e.g. preview their proposal or see the proposal page because it is trying to create the thumbnail URLs for these images. This PR fixes the issue by falling back to the original URL of that file.
馃搶 Related Issues
Testing
config/environments/development.rb
, add the following configuration:config.active_storage.variable_content_types = %w(image/png)
image/jpeg
is allowed from the Decidim system panel (it should be if you haven't changed anything)