You are here

function clone_form_node_form_alter in Node clone 7

Implements hook_form_BASE_FORM_ID_alter().

File

./clone.module, line 185
Allow users to make a copy of an item of content (a node) and then edit that copy.

Code

function clone_form_node_form_alter(&$form, $form_state, $form_id) {

  // Add the clone_from_original_nid value for node forms triggered by cloning.
  // This will make sure the clone_from_original_nid property is still
  // attached to the node when passing through hook_node_insert().
  if (!empty($form['#node']->clone_from_original_nid)) {
    $form['clone_from_original_nid'] = array(
      '#type' => 'value',
      '#value' => $form['#node']->clone_from_original_nid,
    );
  }
}