[support] how to access filefield with hook_nodeapi

Sudheer sudheer.s at binaryvibes.co.in
Tue Jan 22 20:27:38 UTC 2008


Davide Michel 'ZioBudda' Morelli wrote:
> Sudheer ha scritto:
>   
>> Hello,
>>
>> First of all I would like to thank this lits for all the support I am 
>> receiving.
>>
>> I am writing my first module. I would appreciate any help with my question.
>>
>> [...]
>> function loadapp_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL){
>>     switch ($op) {
>>  case'submit':
>> // Do operations here          
>>         break;
>>     }
>> }
>>   
>>     
>
> I don't know the name of this field so my answer is: before "break" insert
> print_r($node);
> exit;
>
> Ok, the node is not saved but you can see which is the exact name of all 
> node's fields, CCK fields too.
> Are you sure for submit? Is not "insert" ? Or is better "prepare" ? I 
> haven't here my Drupal Development book so sorry for the possible errors.
>
> Hope help.
>
> M.
>
>   
Thanks for the reply. Your approach to find the name of the variable is 
very good. Michelle helped with the same question on IRC. I use the 
devel.module and print the node object using the dsm() function.



-- 

With warm regards,
Sudheer. S
http://binaryvibes.co.in



More information about the support mailing list