Recently my description field on Images in the ImageField has stopped being shown with the image.

I had been using this field for the alt tag and as a visual description under the image. This behavior was implemented in a node template file in the following way:

<?php if ($node->field_lead_image[0]['filepath'] != null): ?>
<div id="newsbrief-image"><img src="../../<?php print $node->field_lead_image[0]['filepath']; ?>" alt="<?php print $node->field_lead_image[0]['data']['description']; ?>" /><br /><?php print $node->field_lead_image[0]['data']['description'];?></div><?php endif; ?>

Unfortunately I didn't notice the exact moment this stopped working, but I have read this thread: http://drupal.org/node/296441 and it's implication that the description field was altered in the Alpha 2 release, and my updating to this does coincide with the problem.

Using the code
<pre><?php print_r($node); ?>
I have been able to see the description field is now blank, however, looking at the database I can see the following column in the table for the node type: field_lead_image_data which holds the value: a:1:{s:11:"description";s:20:"Beijing Olympic Logo";}

I did run the update.php and cleared cache etc, but it seems there is now no way of referencing the description field in the node output.

I have also tried setting alt tag and title tag to being custom, but for some reason this only affects adding images to an already existing node and creating a new node these options aren't shown! (Maybe another issue entirely).

Is there anyway i can use the description info I've already added to many images or is this now no longer supported? Should I just try going back to Alpha 1?

Thanks
S

PS. Using CCK rc6 currently not the new rc7 - will that affect this?

Comments

sampeckham’s picture

Category: bug » support
quicksketch’s picture

Status: Active » Closed (duplicate)

It seems like for a long period of time, ImageField (or FileField) was storing data incorrectly. The data is now stored correctly in new versions, but the old data is still stored incorrectly. We're working on fixing this in #402860: Fatal error: CCK data field not always unserialized.