[development] clone a node

Nathaniel Catchpole catch56 at googlemail.com
Mon Jul 21 09:59:03 UTC 2008


You could take a look at the node_clone module if you haven't already:
http://drupal.org/project/node_clone

On Mon, Jul 21, 2008 at 10:55 AM, Lluís <enboig at gmail.com> wrote:
> I have developed a custom module with custom node types and I need to
> make users able to clone nodes; would this be a good way to do so?
>
>      $clone=node_load($value);
>      $clone->is_new = true;
>      $clone->uid = $user->uid;
>      unset($clone->nid);
>      unset($clone->vid);
>      node_save($clone);
>
>
> --


More information about the development mailing list