auto_nodetitle_node_submit

  1. drupal
    1. 7 auto_nodetitle.module function
Drupal 7 auto_nodetitle_node_submit($node, $form, &$form_state)

Implements hook_node_submit().

Generate the node title as soon as the form has been submitted. That way the node preview is shown right too.

File

sites/all/modules/auto_nodetitle/auto_nodetitle.module, line 47
Allows hiding of the node title field and automatic title creation.

Code

function auto_nodetitle_node_submit($node, $form, &$form_state) {
  $setting = auto_nodetitle_get_setting($node->type);
  if ($setting == AUTO_NODETITLE_ENABLED || ($setting == AUTO_NODETITLE_OPTIONAL && empty($form_state['values']['title']))) {
    auto_nodetitle_set_title($node);
  }
}