Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $Id: clonespec.module $
- /**
- * Implementation of hook_clone_node_alter().
- */
- function clonespec_clone_node_alter(&$node, $original_node, $method) {
- if ($node->type == 'specspot') {
- // Set Referenced Order field to original node title
- $node->field_ref_order = $original_node->nid;
- // Empty the assigned AE field.
- if (isset($node->field_assigned_ae)) {
- $node->field_assigned_ae = NULL;
- }
- // Empty the assigned jock field.
- if (isset($node->field_assigned_jock)) {
- $node->field_assigned_jock = NULL;
- }
- // Empty the assigned copywriter field.
- if (isset($node->field_assigned_copy)) {
- $node->field_assigned_copy = NULL;
- }
- // Empty the cart number field.
- if (isset($node->field_cart_number)) {
- $node->field_cart_number = NULL;
- }
- // Empty the needed by field.
- if (isset($node->field_date_needed)) {
- $node->field_date_needed = NULL;
- }
- // Empty the market field.
- if (isset($node->field_market)) {
- $node->field_market = NULL;
- }
- // Empty the needs client approval field.
- if (isset($node->field_needs_client_approval_for)) {
- $node->field_needs_client_approval_for = NULL;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement