We're running into some issues when using Scald with picture 2.x and a fallback image style, resulting in PHP warnings and invalid image paths of the form "{...}/styles/Array/public/{...}".
The reason is that Scald expects $image_style to be a string, while it is in fact an array of the form array('image_style' => $image_style_name, 'mapping_type' => $mapping_type_name).

I'm not entirely sure when or where these changes were introduced (picture and/or breakpoints).

Comments

ciss’s picture

The attached patch solves the issues for us. I've implemented a conditional check for the $image_style structure, since I assume that the original implementation was thoroughly tested and working for picture 1.x (although I couldn't find any pointers to it when comparing picture 1.x and 2.x).

ciss’s picture

Status: Active » Needs review
ciss’s picture

Title: Support picture 2.x » Fallback image style in picture 2.x causes PHP warnings and invalid image style URLs.
Category: Feature request » Bug report
Issue summary: View changes
StatusFileSize
new864 bytes

Updated the title/description after further investigation (/null URLs are actually caused by picturefill.js on Chrome), removed some unnecessary code from the patch.

  • jcisio committed 325b652 on 7.x-1.x authored by ciss
    Issue #2389229 by ciss: Fallback image style in picture 2.x causes PHP...
jcisio’s picture

Status: Needs review » Fixed

I'm not a fan of three levels of IF inside a foreach, because of readability, so I rewrite it a little and commit. Thanks!

Status: Fixed » Closed (fixed)

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