Image field, views and no $node
Eidolon Night - May 27, 2009 - 06:07
| Project: | Imagecache Actions |
| Version: | 6.x-1.x-dev |
| Component: | Text Actions Module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
I'm currently putting together a new front page. I've added an image field to my story content type, and I've created an imagecache preset that takes that image scales it and overlays the title of the node. I'm calling this all from within views 2. The image is loaded fine, but none of the node information is making it. I've tried printing the creation date, title, etc. None of them work.

#1
Depends, is it an image.module image or something attached with imagefield?
The imagefield/filefield CCK thing changed a lot at some point recently, the logic that attempts to backtrack from filename -> owner node may need review.
Can you supply more detail? what code you are pasting in, and what the structure of your actual desired node looks like?
#2
It's an image attached to a node via the imagefield module. I simply set up a view with a field for the image, asking it to be passed through my imagecache preset. My resulting view comes back nearly perfect. The image is scaled, has its corners rounded, etc. The only issue is that I've set imagecache to print the node title on the image, and it doesn't.
The nodes I have in the view are basic story nodes with the addition of an imagefield.
The view is pretty much the basic front page view set to display only 1 result, and changed to display fields.
#3
I'm also having trouble having the imagefield show up in views for anon users. I'm inclined to believe that it's imagefield that's all messed up.
UPDATE: I solved this by switching to just the basic filefield. The images now display on all my views. Still having an issue printing the node title on the image though.
#4
Try the latest dev. I've reviewed the way that node data was being retrieved - it was indeed a bit screwy - some of the SQL was entirely wrong. Worked in testing, but only because of the order of the nodes!
The $node was simply wrong more often than not.
I've reviewed the latest changes to the filefield storage, and think this may work again.
However, I agree there are some other things screwy about filefield at the moment....
#5
Just updated to the latest dev released today, but it still isn't working.
#6
Updated to the May 28th dev and have seen no difference.
#7
Latest stable release, no change.
#8
@Eidolon: What you are trying to accomplish works fine for me.
Are your font files in order?
Have you tried returning a fixed string? Eg.
return 'Print this on my image';I used $node->title to get the node title displayed on my images:
return $node->title;#9
Fixed strings work perfectly fine. I haven't tried the Jun 18 dev yet though.
#10
Despite updating to the June 18 dev of imagecache actions, and the 6.x-3.1 versions of filefield and image field, this is still not working. Static string still work fine, and I can use PHP to load strings from the database. It's simply a matter of the $node object being empty while it should reference the node to which the image is attached.
#11
return $file_data->description;
Also does not work.