Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2. // $Id: clonespec.module $
  3.  
  4. /**
  5. * Implementation of hook_clone_node_alter().
  6. */
  7. function clonespec_clone_node_alter(&$node, $original_node, $method) {
  8.  if ($node->type == 'specspot') {
  9.    // Set Referenced Order field to original node title
  10.    $node->field_ref_order = $original_node->nid;
  11.    // Empty the assigned AE field.
  12.    if (isset($node->field_assigned_ae)) {
  13.      $node->field_assigned_ae = NULL;
  14.    }
  15.    // Empty the assigned jock field.
  16.    if (isset($node->field_assigned_jock)) {
  17.      $node->field_assigned_jock = NULL;
  18.    }
  19.    // Empty the assigned copywriter field.
  20.    if (isset($node->field_assigned_copy)) {
  21.      $node->field_assigned_copy = NULL;
  22.    }   
  23.    // Empty the cart number field.
  24.    if (isset($node->field_cart_number)) {
  25.      $node->field_cart_number = NULL;
  26.    }
  27.    // Empty the needed by field.
  28.    if (isset($node->field_date_needed)) {
  29.      $node->field_date_needed = NULL;
  30.    }
  31.    // Empty the market field.
  32.    if (isset($node->field_market)) {
  33.      $node->field_market = NULL;
  34.    }
  35.    // Empty the needs client approval field.
  36.    if (isset($node->field_needs_client_approval_for)) {
  37.      $node->field_needs_client_approval_for = NULL;
  38.    }
  39.  }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement