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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Allow disabling of auto-created Image Variants #4303
BUGFIX: Allow disabling of auto-created Image Variants #4303
Conversation
Fixes support for the setting `autoCreateImageVariantPresets` that was documented for a long time but never actually evaluated. This change set: * Adjusts `AssetService::assetCreated()` signal to only trigger `AssetVariantGenerator::createVariants()` if the `autoCreateImageVariantPresets` flag is set * Sets the default value of the flag to `true` for greater backwards compatibility * Adjusts `AssetVariantGenerator::createVariant()` to only create a variant if it does not exist already – previously multiple variants with the same identifiers could be created for a single asset leading to undeterministic behavior * Adds a button "Create missing Variants" to the `Variants` tab of the Media Module allowing editors to manually trigger creation of (missing) variants. Fixes: #4300
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.
Works like a charm. Just tested it in a project 💖
@bwaidelich Thanks a lot, that's great to have. |
Hi ;) i just found this pr - were you able to test this @lorenzulrich and is this ready to be merged @bwaidelich - maybe we can include it in the upcoming bugfix release (today or tomorrow). |
Yes, this is good to go IITC |
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.
Tweak according to reviews
Co-authored-by: Bastian Waidelich <b.waidelich@wwwision.de>
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.
LGTM
Fixes support for the setting
autoCreateImageVariantPresets
that was documented for a long time but never actually evaluated.This change set:
AssetService::assetCreated()
signal to only triggerAssetVariantGenerator::createVariants()
if theautoCreateImageVariantPresets
flag is settrue
for greater backwards compatibilityAssetVariantGenerator::createVariant()
to only create a variant if it does not exist already – previously multiple variants with the same identifiers could be created for a single asset leading to undeterministic behaviorVariants
tab of the Media Module allowing editors to manually trigger creation of (missing) variants.Fixes: #4300