Closed (fixed)
Project:
Image
Version:
6.x-1.1
Component:
image_attach
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2011 at 02:45 UTC
Updated:
20 Mar 2011 at 23:01 UTC
Hello,
At the moment if a user leaves the title field blank for an attached image, the title defaults to the filename of the image.
For my use this is problematic, as I'm generating an image caption from the title of the image.
Is there a way to use the title of the node the image is being attached to as the default image title as opposed to the image filename?
I suspect there's some sort of form preprocess hook I can use in my template.php, but I'm still feeling my way around this kind of thing, so any help would be much appreciated.
Thanks in advance!
Comments
Comment #1
joachim commentedIt's happening in the rather ugly image_attach_validate.
What I would suggest is use hook_nodeapi and catch the image node as it's being created in the 'presave' op. You'd need to test that it was an attached image node being created, as opposed to a user creating an image node for itself.
Comment #2
joachim commented(oops. commented on the wrong issue)
Comment #3
miopa commentedI had the same need, but I didn't notice this issue and created a duplicate.
Try this: #1080308: Use node title as default image name when uploading