Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Came across a typo in images.previewlist.inc (and images.previewlist.image.inc in the dev version), line 36:
<?php
$form[$node_image->nid]['preview_image'] = array(
'#prefix' => '<div class="image_fupload_preview">',
'#value' => _fupload_imagepreview($node_image, $node_type),
'#post' => '</div>',
'#weight' => 1,
);
?>
'#post' should be replaced with '#suffix', like so:
<?php
$form[$node_image->nid]['preview_image'] = array(
'#prefix' => '<div class="image_fupload_preview">',
'#value' => _fupload_imagepreview($node_image, $node_type),
'#suffix' => '</div>',
'#weight' => 1,
);
?>
Also, there seems to be a similar bug with a nested div in the form for creating images (node/add/image), which breaks certain themes. Will try to locate it and report back :)
Comment | File | Size | Author |
---|---|---|---|
#6 | images.previewlist.image_.inc_.patch | 507 bytes | tjodolv |
#6 | images.previewlist.imagefield.inc_.patch | 609 bytes | tjodolv |
Comments
Comment #1
grandcat CreditAttribution: grandcat commentedThanks for your help.
Comment #2
tjodolv CreditAttribution: tjodolv commentedNot able to reproduce my problem with the
Comment #3
tjodolv CreditAttribution: tjodolv commentedThis one seems to have snuck its way into the new 3.0 alpha 1
Both previewlist for Image and Imagefield are affected.
Comment #4
grandcat CreditAttribution: grandcat commentedDoes the problem still persist?
Comment #5
tjodolv CreditAttribution: tjodolv commentedYes, on the version i downloaded yesterday it did (3.0 alpha 1, that is). Also in the dev from today (March 13).
images.previewlist.image.inc at line 36
images.previewlist.imagefield.inc at line 73
Comment #6
tjodolv CreditAttribution: tjodolv commentedHere's a patch :)
Comment #7
grandcat CreditAttribution: grandcat commentedThank you very much for your patches.
Fixed now in CVS Head.