image array overwritten when theme called

Created on 19 November 2019, over 5 years ago
Updated 21 July 2025, 11 days ago

This else statement, wipes out the $image array if there is no width or height. In our case, that meant the slideshow's were not apearing, because the theme() function when called was only writing out an image with a path, not the full URL (aka missing the image path)

    else {
      $image = array(
        'width' => 0,
        'height' => 0
      ); 
    }

This code could instead add the width and height to the array, but not sure why one would want that to happen. It should definitely not be replacing the entire array. I'm wondering if there might actually be an issue with the line

elseif ($item["type"] == 'image') {

We are using images, but in a field_collection so maybe that's why $item_type is not reading as an image and there is no width and height? If I remove this else statement the slideshow works fine.

πŸ› Bug report
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States adriancotter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024