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.
Hi!
Tested 8.x-1.x-dev from 2016-Nov-30 and it didn't work for me with view's block on page.
I've have chosen "Background Image" as formatter for image field, but background for body didn't change.
Only when I've added empty element in $elements into viewElements, background image for body element was applied.
'Responsive Background Image' formatter didn't work even with the same changes in code of it's class.
Comment | File | Size | Author |
---|---|---|---|
#5 | bg_image_formatter-fix-empty-element-for-views-2832238-5.patch | 1.61 KB | ChrisSnyder |
#2 | bg_image_formatter-fix-empty-element-for-views-2832238-1-8.x.patch | 694 bytes | khiminrm |
Comments
Comment #2
khiminrm CreditAttribution: khiminrm commentedComment #3
khiminrm CreditAttribution: khiminrm commentedComment #4
PolHi,
Thanks for the report.
Does this patch fix the issue for the two modules ?
Thanks!
Comment #5
ChrisSnyderGood find @khiminrm. I was able to add an empty element array to the Responsive Background Image formatter's class to fix it when used within Views. I also moved the assignment outside of the foreach loop. The patch is attached.
Comment #6
PolHi,
Could you please reroll the patch against latest dev ?
Thanks!
Comment #7
PolThere, I did it. Could you please give some feedback so I can push a first D8 release ?
Comment #8
ChrisSnyderPol,
The patch I submitted looks good to me. I was able to confirm that it works when using the formatter within views and does not cause issue when using the formatter when used within an entity's display.