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
Similar to image styles, the responsive image formatter should implement dependencies and dependency resolving.
Proposed resolution
- Implement
calculateDependencies()
Implement— We don't deal with the removal that meaning we are falling back to the default behaviour and that is disabling the formatter.onDependencyRemoval()
- Tests.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
When a responsive image style is deleted, the responsive image formatter using that style will be disabled,
Comment | File | Size | Author |
---|---|---|---|
#25 | interdiff.txt | 2.08 KB | claudiu.cristea |
#25 | 2657110-25.patch | 8.52 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaHere's a patch.
Comment #3
claudiu.cristea@attiks, maybe you'll find some time to look into this.
Comment #4
claudiu.cristeaOuch, the test.
Comment #5
Wim LeersLooks great!
Nit: s/configurations/configuration/
Nit: s/wa snot/was not/
Comment #6
alexpott8.0.x has now had its final release.
Comment #7
alexpottShouldn't this be using the replacement image style if the image style gets deleted.
Comment #8
claudiu.cristea@alexpott, hm. I thought the same. But now I'm not sure.
Comment #9
catchComment #10
Orizontal CreditAttribution: Orizontal commentedtesting the issu
Comment #11
Orizontal CreditAttribution: Orizontal commentedComment #12
RainbowArrayLet's test to see what is happening right now:
Comment #13
Wim LeersNo, because that would mean it's no longer a responsive image style. The fallback image style is specifically intended for the case of the browser not supporting responsive images. It is not okay to just make all images using a certain responsive image style use the same image style always (i.e. the fallback).
Comment #15
Wim LeersPatch no longer applies.
Comment #16
claudiu.cristeaI fixed also the typos/nits from #5.
Comment #17
Wim LeersThanks!
Comment #19
Wim LeersRandom migrate fails strike again!
Comment #20
alexpottwe can do less here by only saving if the dependencies are different - see views_post_update_serializer_dependencies().... something like:
Comment #21
joginderpc CreditAttribution: joginderpc at Srijan | A Material+ Company commentedRe-roll patch @claudiu.cristea with resolve given solution in last comment #20.
Comment #22
claudiu.cristea@alexpott, here is the change requested in #20 even it seems to me a little... over-engeneering for a one time task :)
Comment #23
dawehnerThis is indeed a nice pattern!
Let's ensure to remove them right before the comment.
For future reference, you could leverage
$this->assertArrayHasKey()
.Comment #25
claudiu.cristeaThank you @dawehner. I fixed based on suggestions from #23.
Comment #26
claudiu.cristeaBack to RTBC as per #23.
Comment #27
dawehnerBack to RTBC. Thank you @claudiu.cristea
Comment #30
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x, thanks!