User login

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;
?>

Resolution

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.