function _biblio_prepare_submit in Bibliography Module 6.2
Same name and namespace in other branches
- 6 biblio.module \_biblio_prepare_submit()
- 7 biblio.module \_biblio_prepare_submit()
- 7.2 biblio.module \_biblio_prepare_submit()
Prepares a biblio node for submit to database.
This function contains code common to both insert and update operations.
Parameters
object $node: An object with bibliographic information as well as other elements.
2 calls to _biblio_prepare_submit()
- biblio_insert in ./
biblio.module - Implements hook_insert().
- biblio_update in ./
biblio.module - Implements hook_update().
File
- ./
biblio.module, line 1837 - Main file for Drupal module biblio.
Code
function _biblio_prepare_submit($node) {
$node->biblio_sort_title = biblio_normalize_title($node->title);
$node->biblio_year = _biblio_numeric_year($node->biblio_year);
if (variable_get('biblio_auto_citekey', 1) && empty($node->biblio_citekey)) {
$node->biblio_citekey = biblio_citekey_generate($node);
}
$duplicate = biblio_hash($node);
if (isset($duplicate) && $duplicate != $node->nid) {
// if this is a potential duplcate, write the nids of the pre-existing and new nodes
$dup_map = array(
'vid' => $duplicate,
'did' => $node->nid,
);
drupal_write_record('biblio_duplicates', $dup_map);
}
}