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
Follow-up to #2534058: [META] Usability of Responsive Image in Core
See point E and F.
Proposed resolution
A- Add a meaningful description to the fallback option.
B- Change option "None" to "None (original image)", just how it is done in #empty_option of ImageFormatter.php
Remaining tasks
- define if "None" should be changed for this Responsive Image form only or all image style list.
- implement patch
- review
User interface changes
None except the listed one.
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#30 | interdiff-25-30.txt | 2.16 KB | Jelle_S |
#30 | i2534066-30.patch | 6.57 KB | Jelle_S |
#1 | clearer_help_message_responsive_image_style--2534066-1--option2.patch | 1.69 KB | Dom. |
#1 | clearer_help_message_responsive_image_style--2534066-1--option1.patch | 1.08 KB | Dom. |
Comments
Comment #1
Dom. CreditAttribution: Dom. commentedTwo patch attached:
option1: fixes point A, fixes point B locally to Responsive Image style. Nothing else is impacted
option2: fixes point A, fixes point B globally: everytime the image_style_options(TRUE) method is called, the result will be impacted, thus potentially other modules.
Comment #3
Dom. CreditAttribution: Dom. commentedReupload patches: it did not apply after #2424805: Toolbar can no longer switch horizontal and vertical -- expects breakpoints ordered from smallest to largest; responsive images need largest to smallest.
Comment #4
Dom. CreditAttribution: Dom. commentedNoob mistake : forgot review status !
Comment #7
Dom. CreditAttribution: Dom. commentedComment #8
cilefen CreditAttribution: cilefen commentedComment #9
RainbowArrayThere is a fallback image description added in #2334387: UI changes to support current responsive image standards.
The none (original image) change is a separate improvement, and that can continue on here.
Comment #10
attiks CreditAttribution: attiks at Attiks commentedNeeds work and needs a test to make sure original image works as expected
Comment #11
attiks CreditAttribution: attiks at Attiks commentedPatch rerolled, original added to tests
Comment #14
attiks CreditAttribution: attiks at Attiks commentedDescription is already added, removed it from the patch
Comment #16
attiks CreditAttribution: attiks at Attiks commentedIs breaking on empty string, will need to use a constant
Comment #17
Jelle_SThe option for the original image can't be an empty string because of the code in
ResponsiveImageStyle::isEmptyImageStyleMapping
. New patch attached.Comment #18
Jelle_SComment #21
Jelle_SPatch with fixed unit test. This patch will still fail because I discovered an other issue while working on this: #2573221: Keyed mapping static cache is not rebuilt when overwriting an existing mapping
Comment #22
Jelle_SAlso, I just noticed we're unit testing this, but not testing the actual output with a mapping using the original image, so more tests are needed.
Comment #25
Jelle_SNew patch with tests. Will still fail because of #2573221: Keyed mapping static cache is not rebuilt when overwriting an existing mapping.
Comment #29
attiks CreditAttribution: attiks at Attiks commentedSmall nit picks
===
$this->t
1 line is ok
move [ up
move ] down
Comment #30
Jelle_SNew patch addressing #29.
4 & 5: Didn't do that because indentation would be wrong then.
Comment #31
attiks CreditAttribution: attiks at Attiks commentedI'm when when the bot is happy
Comment #35
attiks CreditAttribution: attiks at Attiks commentedComment #36
webchickCommitted and pushed to 8.0.x. Thanks!
Only thing I wonder is about swapping the ordering so that original image is before empty image, but that could always be a follow-up and/or an improvement in 8.1.
Comment #38
attiks CreditAttribution: attiks at Attiks commentedFollow-up created at #2580113: Change order of original and empty image