You are here

function node_clone_form_node_form_alter in Node clone 8

Implements hook_form_BASE_FORM_ID_alter().

File

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

Code

function node_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,
    );
  }
}