Closed (duplicate)
Project:
ImageCache Actions
Version:
6.x-1.1
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2008 at 00:24 UTC
Updated:
7 Feb 2009 at 16:34 UTC
I am trying to overlay the node title on the image using the textactions. "return $node->title" entered in text box and "Evaluate text as PHP code" box is checked. I am using cck imagefield for images. I get an error:
Table 'lsmonroe.image' doesn't exist query: SELECT nid FROM image INNER JOIN files AS f WHERE f.filepath = 'sites/default/files/saddle.jpg' LIMIT 1 in C:\xampp\htdocs\lsmonroe\sites\all\modules\imagecache_actions\textactions.inc on line 264.
Not sure if it is a bug, a problem with imagecache, a problem with imagefield or the sytax "return $node->title"
Comments
Comment #1
dman commentedThe image it is looking for is an image.module image node. That is the $node that gets loaded.
AFAIK there is no explicit support for imagefield. However, the code certainly should be a bit more careful before making that database lookup!
Imagefield doesn't have much extra metadata attached to images (last time I looked) - although I guess 'title' is certainly useful.
Can anyone suggest the appropriate SQL to get the title from a filename? Or the parent node? (I don't use the imagefield approach). It should be pretty easy, and would be what you can paste into the custom code field.
I'll definitely remove the dependency on image.module in the next roll (but not the support).
Comment #2
ndwilliams3 commentedThe nid for the associated node is in the imagefield array, so it should be possible to work backwards to get the node title. However , that is above my php knowledge level! Any help would be appreciated.
Comment #3
MedicSean37 commentedYeah I would like to use return "$node->title;" for a node that use imagefield.
Subscribing
Comment #4
dman commentedAnyone that is using imagefield can please have a look at what is needed for this.
I'm not using it, at least not in this way, but would be happy to review any contribution that does the job efficiently.
Comment #5
ablewave commentedsubscribing
Comment #6
asak commentedsubscribing. what i need is $node->nid .
Comment #7
dman commentedFixed in dev. Please try it out.
http://drupal.org/node/363434