Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When some formatter configuration for the thumbnail formatter is exported and the associated image style isn't there, it blows up.
Proposed resolution
To help prevent this, we should make sure the image style is added as a dependency to the formatter configuration.
Remaining tasks
Create a patch that overrides ::calculateDependencies for VideoEmbedThumbnailFormatter.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedInitial patch based entirely on the core ImageFormatter. Need to look into how this can be tested.
Also need to deal with the colorbox formatter which also has an image style.
Comment #4
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedAdded a test. Tests both the thumbnail and colorbox formatter, so this should fail until the colorbox formatter has been accounted for.
Comment #12
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedAdded test assertions for when the image style is deleted and added support in the colorbox formatter for onDependencyRemoval and calculateDependencies.
Still 1 failing colorbox test.
Comment #20
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedAnnoying, but this should green everything up.
Comment #21
benjy CreditAttribution: benjy at PreviousNext commentedAssigned to the wrong variable name.
I'd have thought you'd have gotten away with KTB just for testing the dependencies?
Comment #22
benjy CreditAttribution: benjy at PreviousNext commentedCross posted with the bot.
Comment #23
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #24
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedI might try a KTB version if I get time and see if it's easy enough to convert. This really isn't using a browser, but it is using some methods off WebTestBase.
Comment #32
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedKTBified.
Comment #34
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #35
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedComment #36
benjy CreditAttribution: benjy at PreviousNext commentedLooks good apart from there is no upgrade path. Should be as simple as re-saving the form that selects the image and then re-exporting the config.
Comment #37
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedYeah, I think it's fine for this to be an additional benefit for new installations and installations that decide to resave their formatters.
Thanks for the review.
Comment #39
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commented