function serial_clone_node_alter in Serial Field 7
Same name and namespace in other branches
- 8 serial.module \serial_clone_node_alter()
Implements hook_clone_node_alter().
File
- ./
serial.module, line 109 - The Serial module main file.
Code
function serial_clone_node_alter(stdClass $node) {
// Reset values of all serial fields when cloning a node.
foreach (field_info_instances('node', $node->type) as $field_name => $instance) {
$info = field_info_field($field_name);
if ('serial' === $info['type']) {
$node->{$field_name} = array();
}
}
}