Closed (fixed)
Project:
ImageField
Version:
6.x-3.7
Component:
Code
Priority:
Minor
Category:
Support request
Assigned:
Reporter:
Created:
7 Dec 2010 at 16:50 UTC
Updated:
5 Jan 2011 at 11:50 UTC
Hi,
I tried simply to set it by defining on custom node creation like this:
$node->filed_fieldname[0]['filepath'] = $variable_holding_an_image_path_value;
The result was strange... Devel shows that filed_fieldname was created and 0 array was created but the 0 array is empty... May be that is because I have not defined all filed data?
Any way some of them gives me some trouble:
1. File id (fid) is there some hook to get the last one?
2. Time-stamp... is it counting days form our era or something?
3. Status what does that one means?
I really would be happy to here how to do this properly...
Anyway thanks for your help in advance ;)
Comments
Comment #1
quicksketchThe the handbook on programmaticly saving FileField entries. The only property you need to set is the "fid" property. http://drupal.org/node/330421
Comment #2
quicksketchCode in #201983: How To: Migrate from Image.module to ImageField Documentation Project would also work to learn how to do this.
Comment #3
POVYLAZZZ commentedThanks a lot.
Comment #4
POVYLAZZZ commentedHello again...
I have included a script to include the image. It all seamed fine then I tried to edit the field I noticed that the field is empty. What could be the matter?
Here is the code:
Comment #5
quicksketchIt doesn't look like you called node_save() after assembling the $node variable.
In any case, help with custom coding it outside the scope of help I provide in the issue queue.
Comment #6
POVYLAZZZ commentedthanks node_save() fixed it ;) silly me :P