Rendering an Image_attach field in Views does not work when used through [patched] Nodereferrers or CCK's Nodereference Relationships.
The reason lies in contrib/image_attach/image_attach_views_handler_field_iid.inc on line 42. A hardcoded field name is used instead of $this->field_alias when getting the Image node.

This patch simply replaces that hardcoded name ($values->image_attach_iid) with $values->{$this->field_alias}.

I've tested it with Relationships through both Nodereferrers and Nodereference fields and I think that's all that needs to be done. It's my first patch though so I'm bound to have made some mistake...

Created the patch from the image module root.

CommentFileSizeAuthor
field_alias.patch846 bytestwod

Comments

sun’s picture

Title: Patch to make Image_attach work with Relationships in Views 2 » Hard-coded field name in Views handler of Image Attach
Status: Needs work » Needs review

Better title. Patch looks good. Just needs one confirmation.

sun’s picture

Status: Needs review » Fixed

Committed.

Heh - wow! That was "your first patch"? Nice! :)

twod’s picture

Yup, my first patch it was!
Looks like one of the few so far which I haven't missed something on. :s hehe

sun’s picture

btw, sp3boy is desperately seeking for a patch review and test in these issues:

#298702: Properly validate image uploads
Looks pretty good (visually) already, but needs testing.

#81102: Attach Multiple Images with image_attach using Drupal upload mechanism
Not sure about that one.

Status: Fixed » Closed (fixed)

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