When add to default views list "Recent content" field image from content type "Article" got
Fatal error: Unsupported operand types in /home/alex/www/drupal/core/modules/responsive_image/responsive_image.module on line 118

there is line with

<?php
$attributes += $variables['item_attributes'];
?>

When check with var_dump on $variables['item_attributes'] got NULL

CommentFileSizeAuthor
#2 2506511-2.patch763 bytesjoshi.rohit100

Comments

Codenator’s picture

Issue summary: View changes
joshi.rohit100’s picture

Status: Active » Needs review
StatusFileSize
new763 bytes

Simply check for array before appending.

or I think, we can do like this on line 112 -

instead of

   $attributes = array();

This -

$attributes += is_array($variables['item_attributes']) ? $variables['item_attributes'] : [];
justachris’s picture

Status: Needs review » Closed (duplicate)

Duplicate of #2483357: Fatal "Unsupported operand types" error when using responsive images in views. Similar steps to reproduce, same error provided.

justachris’s picture