You are here

function biblio_marc_form_biblio_node_form_submit in Bibliography Module 7.2

1 string reference to 'biblio_marc_form_biblio_node_form_submit'
biblio_marc_form_biblio_node_form_alter in modules/marcParse/biblio_marc.module

File

modules/marcParse/biblio_marc.module, line 68

Code

function biblio_marc_form_biblio_node_form_submit($form, &$form_state) {
  global $user;
  $node_data = array();
  $dups = array();
  if (strlen($form_state['values']['paste_data_marc'])) {
    list($node_data, $dups) = biblio_marc_biblio_import($form_state['values']['paste_data_marc'], array(), FALSE, NULL, FALSE, TRUE);
  }
  if (!empty($node_data) && is_object($node_data[0])) {
    $form_state['values'] = array_merge($form_state['values'], (array) $node_data[0]);
    $form_state['input']['biblio_type'] = $form_state['biblio_type'] = $node_data[0]->biblio_type;

    //    $form_state['storage']['biblio_type']  = $node_data[0]->biblio_type;
  }
  elseif (!empty($dups)) {
    $message = t('The MARC node that you are trying to paste into the form already exists in the database, see !url', array(
      '!url' => l('node/' . $dups[0], 'node/' . $dups[0]),
    ));
    form_set_error('paste_data_marc', $message);
  }
  $form_state['rebuild'] = TRUE;
  return;
}