Skip to content
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

Merged

Conversation

bwaidelich
Copy link
Member

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

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
Copy link
Member

@ahaeslich ahaeslich left a 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 💖

@lorenzulrich
Copy link
Contributor

@bwaidelich Thanks a lot, that's great to have.

@mhsdesign
Copy link
Member

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).

@bwaidelich
Copy link
Member Author

Yes, this is good to go IITC

Copy link
Member Author

@bwaidelich bwaidelich left a 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>
@mhsdesign mhsdesign merged commit 28d568d into 7.3 Nov 1, 2023
9 checks passed
@mhsdesign mhsdesign deleted the bugfix/4300-allow-disabling-of-autocreated-image-variants branch November 1, 2023 10:21
Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants