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.
ResponsivelmageMapping config entities depend on the image styles they use but their is not dependency declared. There should be.
Beta phase evaluation
Issue category | Bug because a configuration dependency is missing. |
---|---|
Issue priority | Not marking critical since whilst configuration will change there is no schema change and it can easily be fixed by re-saving the mapping. Major because correct dependencies ensure that Drupal works. |
Comment | File | Size | Author |
---|---|---|---|
#24 | 2383165.24.patch | 6.84 KB | alexpott |
#24 | 23-24-interdiff.txt | 6.32 KB | alexpott |
#23 | 2383165.23.patch | 4.25 KB | alexpott |
#23 | 20-23-interdiff.txt | 4.86 KB | alexpott |
#20 | interdiff-2383165-17-20.txt | 846 bytes | sidharrell |
Comments
Comment #1
alexpottPatch with unit test.
This is also not critical because we do not provide any responsive image mapping default configuration in core.
Comment #2
Wim LeersNoticed this problem while reviewing #2260061: Responsive image module does not support sizes/picture polyfill 2.2.
Comment #5
Jelle_SComment #6
Wim LeersYeah, the patch cannot possibly pass, because the config entity has been renamed. Should be a simple reroll though.
Comment #8
sidharrell CreditAttribution: sidharrell commentedreroll of #1
Comment #9
sidharrell CreditAttribution: sidharrell commentedComment #11
sidharrell CreditAttribution: sidharrell commentedmethod names changed.
Comment #13
sidharrell CreditAttribution: sidharrell commentedhmmm.
Comment #15
sidharrell CreditAttribution: sidharrell commentedoh, no, no, no.
You do not get to win this fight, test failures!
I get to win!
Comment #17
sidharrell CreditAttribution: sidharrell commentedgrrr.
Comment #19
alexpottYou need to account for the differences when
image_mapping_type
is equal tosizes
. Plus the test needs to test this too.Comment #20
sidharrell CreditAttribution: sidharrell commentedthis made it pass locally. It should get a green from testbot.
@alexpott you mean something like this in the unit test:
$entity->addImageStyleMapping('test_breakpoint', '1x', array('sizes'=>array('sizes'=>'??', 'sizes_image_styles'=>'??')));
Comment #21
alexpott@sidharrell we need to add dependencies for image styles listed in
sizes_image_styles
if theimage_mapping_type
is sizes.Comment #22
sidharrell CreditAttribution: sidharrell commented@alexpott that might be a little beyond me at this point. I don't really understand what the code is doing, I just picked it up for the "Novice" "Needs Reroll" tags.
Comment #23
alexpottAdded dependencies for both types of image style mappings.
Comment #24
alexpottLet's use loadMultiple because then we can't load a non existing image style and it's more performant. ANd we can refactor some similar code in the field formatter.
Comment #25
Wim LeersThis patch looks awesome! Only found the tiniest of nitpicks, which can be fixed on commit.
Wow, very elegant! :)
Can be
string[]
, can it not?Comment #26
webchickChanged to string[], and also added a missing space on one of the switch statements.
Committed and pushed to 8.0.x. Thanks!