It looks like the function image_display calls theme('image', ...) with attributes as a string, but the function theme_image expects attributes to be in array format which gives errors (warnings),
warning: Invalid argument supplied for foreach()
(I am not really sure if my testinstallation is using latest version of everything so if noone else has this problem this is probably because I havent updated them, will try to update in a day or to and recheck this.)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | image-cvs-22533.patch | 808 bytes | Robrecht Jacques |
| #2 | image_4.patch | 994 bytes | pz |
Comments
Comment #1
pz commentedUpgraded to priority normal.
There seems to be something wrong with drupals upload function now so I can't upload patch, so here is a manual fix
$attr = array('width' => $info['width'], 'height' => $info['height']) + $attributes;should replace line 346 which was previously
$attr = 'width="'.$info['width'].'" height="'.$info['height'].'" ' . drupal_attributes($attributes);Comment #2
pz commentedPatch
Comment #3
pz commentedtheme_image has now changed back, so this patch should not be applied.
Comment #4
pz commentedShould probably be applied against cvs but not 4.6
Comment #5
pz commentedComment #6
walkah commentedis this still an issue? doesn't look like it to me...
closing.
Comment #7
pz commentedIf I read the files correctly, the cvs version the function theme_image in file includes/theme.inc has changed and now wants an array instead of a string. For the 4.6.0 branch it wants a string and this patch should not be applied.
I am setting this to patch again for cvs, feel free to close it again if I have misunderstood anything.
Comment #8
Robrecht Jacques commentedI can confirm this is still an issue in CVS:
<span class="image preview"><img src="http://localhost/~robrechtj/drupal-cvs/files/images/06_13_0.jpg" alt="a test image" title="a test image" /></span>widthorheightattribute is set!<span class="image preview"><img src="http://localhost/~robrechtj/drupal-cvs/files/images/06_13_0.jpg" alt="a test image" title="a test image" width="640" height="480"/></span>widthandheightare presentThe reason is that in CVS "theme_image' now runs a 'drupal_attributes' on the 'attr' parameter. This parameter has changed from a string to an array in revision 1.235 of "theme.inc".
So, this patch NEEDS to be applied to CVS. And it SHOULD NOT be applied to 4-6.
Comment #9
Robrecht Jacques commentedPatch ready to be committed.
One more thing:
drupal_attributesreturns an empty string if$attris not an array, that is why thewidthandheight"disappear".Comment #10
walkah commentedcommitted, thanks!
Comment #11
(not verified) commentedComment #12
Tobias Maier commentedComment #13
(not verified) commentedComment #14
(not verified) commentedComment #15
(not verified) commented