Problem/Motivation
Picture tag sources appear in inverse order
Steps to reproduce
Create a responsive image style and set a image field to render with it
Proposed resolution
Change this:
$breakpoints = array_reverse(\Drupal::service('breakpoint.manager')->getBreakpointsByGroup($responsive_image_style->getBreakpointGroup()));
foreach ($responsive_image_style->getKeyedImageStyleMappings() as $breakpoint_id => $multipliers) {
if (isset($breakpoints[$breakpoint_id])) {
$variables['sources'][] = _responsive_image_build_source_attributes($variables, $breakpoints[$breakpoint_id], $multipliers);
}
}
to this:
$breakpoints = array_reverse(\Drupal::service('breakpoint.manager')->getBreakpointsByGroup($responsive_image_style->getBreakpointGroup()));
foreach (array_reverse($responsive_image_style->getKeyedImageStyleMappings()) as $breakpoint_id => $multipliers) {
if (isset($breakpoints[$breakpoint_id])) {
$variables['sources'][] = _responsive_image_build_source_attributes($variables, $breakpoints[$breakpoint_id], $multipliers);
}
}
Remaining tasks
Test it
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3378419-picture-tag-sources.patch | 1.36 KB | emil stoianov |
Issue fork drupal-3378419
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
emil stoianov commentedFor those who need the patch now
Comment #4
cilefen commentedThe tag sources appear in inverse order as compared to what?
Comment #5
longwavePlease explain - maybe with an example - of the current output, what you think the output should be, and why.
Comment #7
pameeela commentedNo additional info provided so I'm closing this, if anyone is able to reproduce it please update the issue summary with steps.