Hi there,
need some help with this..
I try to convert a module to D7
My problem is how to save some meta dat to the file object.. What is the best hook to call the "file transfer function" is the validate hook the right one oder better hook_node_presave oder hook_field_presave?
After tranfering the file to the external server, I get the scribd_doc_id back, and this should saved to the file object.
How to solve this?
<?php .install
/**
* @file a schema
*/
/**
* Implements hook_field_schema().
*/
function scribdfield_field_schema($field) {
return array(
'columns' => array(
'fid' => array(
'description' => 'The {file_managed}.fid being referenced in this field.',
'type' => 'int',
'not null' => FALSE,
'unsigned' => TRUE,
),
'scribd_doc_id' => array(
'description' => 'Scribd DOC ID',
'type' => 'int',
'not null' => FALSE,
'#default_value' => '0',
),
),
'indexes' => array(
'fid' => array('fid'),
'scribd_doc_id' => array('scribd_doc_id'),
),
'foreign keys' => array(
'fid' => array(
'table' => 'file_managed',
'columns' => array('fid' => 'fid'),
),
),
);
}
<?php .module
/**
* Implements hook_field_validate().