[development] Clone Node with File Attachments

Philippe Jadin philippe.jadin at gmail.com
Thu Dec 13 08:47:12 UTC 2007


>
> upload.module has the code you'll need to study--specifically,
> upload_nodeapi and upload_save.


Note also that when you delete the original node, the original files
attached to the cloned node will be deleted as well.

There is work to assign files to user instead of nodes, and afaik this would
solve the problem

Philippe


>
>
> Note that saving file associations is limited by a permission.
>
> The key question to consider is, what does upload do with a *new* node? In
> this case, any files associated with a node are those that were just
> uploaded.
>
>    // New file upload
>    elseif (strpos($file->fid, 'upload') !== FALSE) {
>
> This won't help you, as your files array doesn't contain this marker.
>
> Consider instead:
>
> elseif ($node->old_vid && is_numeric($fid)) {
>
> You could consider tricking upload.module into doing the handling by
> setting
> an old_vid. Or else just write your own handling based on upload_save.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20071213/397c247d/attachment.htm 


More information about the development mailing list