Hello!
I have been out for over a month, and after coming back, I am happy to see how much activity there is here! Thanks, Ron!
Now to the bug report:
I am trying to import a file with a bibtex entry of the Conference paper type (@InProceedings). The resulting node comes without the conference title (that should go to the biblio_secondary_title field). I noticed that in the file bibtexParse/PARSEENTRIES.php, lines 626-628, function bib2node(), there is the following:
$node['biblio_secondary_title'] = (!empty($entry['journal'])) ? $entry['journal'] : NULL;
$node['biblio_secondary_title'] = (!empty($entry['booktitle'])) ? $entry['booktitle'] : NULL;
$node['biblio_secondary_title'] = (!empty($entry['series'])) ? $entry['series'] : NULL;
I guess that the the "series" entry is overwriting with a NULL value the booktitle value. And surely enough, if I add a "series" entry to my bibtex file, I get that as the Conference title.
Sorry if I am missing something in the bug report.
Cheers!
Maira
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | biblio_preserve_defined_bibtex_imports.patch | 2.05 KB | Frank Steiner |
Comments
Comment #1
Frank Steiner commentedRight, this must be reworked to use case distinctions for different types, but I guess this must be done carefully and I'm not sure if can always work, esp. for custom types etc. Since we had that problem with a custom type, I'm using my hooks (http://drupal.org/node/339385, not sure if it applies to the latest develop version) and use sth. like this:
Comment #2
Frank Steiner commentedHmm, I just wonder if it wouldn't be enough to remove the NULL from line 2 and 3, so that a defined biblio_secondary_title can be overwritten but not deleted anymore. I doesn't seem to make sense to remove the journal title if no book title is set...
Comment #3
Frank Steiner commentedComment #4
rjerome commentedAdded to HEAD will come to 6-1 shortly.
Ron.
Comment #5
dunlop commentedI have found this change in logic to be very sensible and something that should probably be applied throughout the PARSEENTRIES.php code.
For example the original patch made a number of changes of the form:
which I extended to the journal type:
and that solved a problem I was having where all my journal titles were being imported empty.
But looking deeper there are many lines of code with the same logic that I think would be improved by applying the pattern established in the patch of comment #3.
Comment #6
Frank Steiner commentedI don't understand your point: The code doesn't need to be adjusted for the journal type because it is assigned first, so the biblio_secondary_title either get's the journal value or becomes NULL and I guess from phps point of view, setting the field to NULL is the same as leaving it undefined.
You need the if-then-clause only for redefining fields that could have been set before. Or I don't get what you mean....
Comment #7
dunlop commentedOk you are likely correct when it comes to my suggested change for journal since it is assigned first. Perhaps the journal title was being put in correctly initially and then it was being overwritten by a null from booktitle or series from the pre-patched code. By that I mean before the changes of the patch from comment #3 and not my additional change.
But there are other places where my suggested changes in logic would apply. For example:
should probably be:
Comment #8
Frank Steiner commentedRight, but the patch from #3 is doing exactly what you suggest for the biblio_publisher field. And I don't see any more fields that need the same treatment...
Comment #9
dunlop commentedYou're right. Sorry for the interruption and keep up the good work.
Comment #10
rjerome commentedFYI, these changes are in the new -dev version.
Comment #11
catdevrandom commented