Biblio module importing Biblio from PubMed node referenced but not created
The nodes are, in fact, being saved. They are in the Drupal database node table with a user ID of zero.
Very very oddly, however, instead of displaying $node->uid = 0 nodes as authored by "Anonymous" (or "Visitor" or whatever you changed your anonymous user string to), Drupal returns "Page not found."
Weirdness.
Anyhow, the cause in this case is the way information is getting passed to biblio_node_save.
The function biblio_node_save itself actually takes everything attached to $node as an array element and turns it into an object before calling Drupal core's own
There is a little bit of potential weirdness here in that it looks like http://api.drupal.org/api/function/_node_save_revision/6 grabs the uid for the revision from the global $user passed on by node_save, rather than being able to programatically decide who owns a revision.
Node save in passing things on to drupal_write_record seems to retain the uid attached directly to the node object though, so that should be enough.
The problem, then, is getting the $node to have a UID attached to it, because node_save is called by our frightful object oriented friend bib2node, which constructs all its values from bibtex input.
<?php
module_load_include('php', 'biblio', 'bibtexParse/PARSEENTRIES');
$bibtex = new PARSEENTRIES();
$bibtex->loadBibtexString($data);
// $bibtex->openBib($file->filepath);
$bibtex->extractEntries();
if ($bibtex->count) {
$nids = $bibtex->bib2node($batch, $session_id);
}
return $nids;
?>
Comments
Post new comment