Closed (won't fix)
Project:
ImageCache Actions
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2009 at 06:07 UTC
Updated:
18 Mar 2016 at 18:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dman commentedDepends, 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?
Comment #2
eidolon nightIt'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.
Comment #3
eidolon nightI'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.
Comment #4
dman commentedTry 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....
Comment #5
eidolon nightJust updated to the latest dev released today, but it still isn't working.
Comment #6
eidolon nightUpdated to the May 28th dev and have seen no difference.
Comment #7
eidolon nightLatest stable release, no change.
Comment #8
waddles commented@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.
I used $node->title to get the node title displayed on my images:
Comment #9
eidolon nightFixed strings work perfectly fine. I haven't tried the Jun 18 dev yet though.
Comment #10
eidolon nightDespite 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.
Comment #11
eidolon nightreturn $file_data->description;
Also does not work.
Comment #12
gone404 commentedEidolon, I'm with you on this one (nice username, I love that POEm)
I too am having difficulty getting any $node or even $form_state info into a custom action. It's not a font problem, as I can display strings all day.
I am going to try to update to imagecache_actions-dev. And see what happens.
Comment #13
gone404 commentedJust updated to 2.x-dev. Unable to get $node->title. I am testing this each time by creating a new node (not in the imagecache actions test area with the drupal logo).
Comment #14
gone404 commentedI've attached an image result. The text after the dash is supposed to be $node->title.
Comment #15
scottbaetz commentedI'm really struggling with this same problem. I have two web servers. One is an Ubuntu Server, one is a Mac Server (current release of both). Here's the weird part, for sites that are on the Ubuntu Server, works great, for those on the Mac Server... doesn't work. I suspect this may have something to do with how PHP is handling this..
Is there a PHP expert on this string who might point us in the right direction?
Comment #16
reswild commentedI had the same problem, but it solved itself when I updated to the latest version of ImageCache Actions (6.x-2.0). I'm on a linux server running PHP 5.2.11.
Comment #17
dman commentedOMG, you are following 2.0-dev? It's dangerous at the moment. But enjoy.
Comment #18
xbery commentedSame here. Everything is set and still getting nothing. I have checked the node object with devel and also made a little research in the source code. Hope this to be fixed soon :-(
EDIT: I have tried every version (incl. 1.7, 2.0 and dev). None works.
Also I have identified the problem - the problem is located in the util.inc file where the node finder function based on searching node id with supplied file name is located. This function doesn't work at all. Could someone be so kind and rewrite it? I did some experiments myself with no results so far. Perhaps the best way would be to come out with solution based only on searching the file name within the database or to try (haven't found a way to do that) finding the node ID based on supplied arguments from the node body itself. My logic flow was that the imagecache loads the image on the page request and I tried to load the node with help of some node_title or menu_active_title (active_trail) but the functions returned only blank arrays or variables.
I am a little desperate now.
Comment #19
dman commentedIt only works for cases tested so for - that is:
images attached as core file uploads to a file
images attached as imagefield/filefield cck data
If you've created another situation, that may not be known.
Data available to the node lookup is based on filename only and works back from there. This has been documented several times. All the imagecache process knows is the absolute name of the file that was requested from the HTML page that was rendered.
The image generation process knows nothing about the Drupal PHP page, so page titles or menu paths are not available at that point.
There is no 1:1 match between file path and node, only some common guesses.
Pulling context from page referrer or embedding is not reliable or even possible in views context.
If you want something that generates images dynamically on-the-fly, then you should use something different from imagecache. Imagecache is not context-sensitive, it just renders one image based on one path request.
No more support can happen if folk don't describe how they have attached the image in the first case, and provide examples. image_attach for example is several levels of redirection away from the caller context. Different versions of filefield have changed the database schema over the last few years, but it worked last time a stable version was tested.
Comment #20
xbery commentedHi all,
it works! I tested it now with versions of imagecache 6.x-2.0-beta10, ImageCache Actions 6.x-1.7, FileField 6.x-3.7, ImageField 6.x-3.7. I managed to do it like this:
Comment #21
fietserwinD6 EOL. This module's D6 issues already haven't received any attention for over a year. Closing them all unconditionally now.