After attaching an image to a Story and creating news listing in Views2 I got following messages in lines 702 and 703. Quick workaround attached.

CommentFileSizeAuthor
image.module.patch701 bytesunjello

Comments

joachim’s picture

Hmm, we should never be getting there without a node title!
That workaround works, but the proper fix is to get a node title into that $node object.

You're using the attached image field, right?

The best fix I think would be at this point:

      $result = db_query("SELECT nid, iid FROM {image_attach} WHERE nid IN (" . $nids_string . ") ORDER BY weight");

add a JOIN to {node} there and get the title.
That necessitates a change in the storage in $attached_images, as we're no longer just stashing a flat array of nids.

Come to think of it, we could move the call to image_load() into pre_render() too -- that might save a query or two if the same images are attached to different stories. That then means that $attached_images is an array of pseudo-$node objects.

So quite a big patch...will work on it later :)

joachim’s picture

Status: Active » Closed (duplicate)

Almost certainly obsolete -- the image attach theme functions have changed a lot since this.