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 :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grandcat’s picture

Thanks for your help.

tjodolv’s picture

Status: Active » Closed (fixed)

Not able to reproduce my problem with the

that was not closed in the form for creating images (node/add/image). I did find it, but can't reproduce it. Maybe my theme was doing it and I fixed it somehow without realizing it.. :)
tjodolv’s picture

This one seems to have snuck its way into the new 3.0 alpha 1

Both previewlist for Image and Imagefield are affected.

grandcat’s picture

Does the problem still persist?

tjodolv’s picture

Yes, 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

tjodolv’s picture

grandcat’s picture

Version: 6.x-2.2 » 6.x-3.x-dev
Status: Closed (fixed) » Fixed

Thank you very much for your patches.
Fixed now in CVS Head.

Status: Fixed » Closed (fixed)
Issue tags: -markup, -nesting

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