[development] Clone Node with File Attachments

Ron Parker sysop at scbbs.com
Wed Dec 12 23:02:09 UTC 2007


I actually figured out how to get the file attachments from the original 
node to appear on the submission form for the new node:

/**
 * Implementation of hook_prepare().
 */
function agenda_prepare(&$node) {
  if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'clone') {
    $orig_agenda = node_load(arg(1));
    $node->files = $orig_agenda->files;
  }
}

HOWEVER,  when I click on the "submit" button and save the new node, the 
file attachments do NOT appear.  Can someone tell me what I'm missing here?

Thanks!

-ron

Ron Parker wrote:

> I understand that the current node_clone.module does not support file 
> attachments.
>
> I would like to clone a node, and if the node has file attachments, 
> copy those attachments to the new node. Can someone point me in the 
> right direction on this?
>
-- 
Ron Parker
Software Creations               http://www.scbbs.com
Self-Administration Web Site     http://saw.scbbs.com
SDSS Subscription Mgmt Service   http://sdss.scbbs.com
Central Ave Dance Ensemble       http://www.centralavedance.com
R & B Salsa                      http://www.randbsalsa.com



More information about the development mailing list