CCK Field + PHP default value + Clone

millenniumtree - December 11, 2008 - 21:08

I've created a PHP field to hold a unique ID number.
When a node is created from scratch, the default value is generated with a bit of PHP&SQL code
MAX(blah)+1

This works great for new nodes, but when I clone a node, it carries the existing value over.

What I'd like to do is regenerate the value for that field when a node is cloned.

I've installed the unique_field module (http://drupal.org/project/unique_field) which properly prevents duplicate values in that field, but it doesn't know to re-default the field.

Ideas much appreciated.

 
 

Drupal is a registered trademark of Dries Buytaert.