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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

khiminrm created an issue. See original summary.

khiminrm’s picture

khiminrm’s picture

Issue summary: View changes
Pol’s picture

Hi,

Thanks for the report.
Does this patch fix the issue for the two modules ?

Thanks!

ChrisSnyder’s picture

Status: Active » Needs review
FileSize
1.61 KB

Good 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.

Pol’s picture

Status: Needs review » Needs work

Hi,

Could you please reroll the patch against latest dev ?

Thanks!

Pol’s picture

Status: Needs work » Fixed

There, I did it. Could you please give some feedback so I can push a first D8 release ?

ChrisSnyder’s picture

Pol,

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.