When trying to import a bibtex file, I get the following error... one time for each bibtex entry in the file:
warning: Invalid argument supplied for foreach() in /var/www/PHP/drupal/modules/biblio/bibtex.php on line 1192.
I have attached a copy of the bibtex file.
In the database, I get an entry in the database for each item that contains no information.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | exportlist_bibtex.txt | 6.71 KB | danaktivix |
| #9 | exportlist_endnote.txt | 8.2 KB | danaktivix |
| #5 | bibtex.jpg | 98.44 KB | rjerome |
| greg-bibtex1.txt | 663 bytes | schultz |
Comments
Comment #1
rjerome commentedMost likely this is caused by entries without any authors. This issue is fixed in the 5.x -dev version and that fix will be pushed to a new release soon.
Ron.
Comment #2
rjerome commentedOpps, I made that comment before looking at the attachment. Clearly they have authors, so my guess is the leading comma before the author names. There would normally be a bibkey before this comma. I'll check the bibtex parser to see what it's doing with this empty field.
Ron.
Comment #3
schultz commentedWell actually, the bibtex entries HAD the bibkey info, but the first time it failed I tried removing it since I noticed that the export code includes that extra comma... so I assumed if it was okay in the export it should be okay in the input. Thanks for the help! By the way, we would love to have a bibkey be one of the entries on the create biblio page and have it stored in the database so that it appears in the exported files. Should I add a feature request?
alan
Comment #4
schultz commentedAny news on bibtex import? I can give other examples of bibtex files that fail.
Comment #5
rjerome commentedI'm not seeing any errors when I import the attached file (see attached image). Could you post another which causes error.
Comment #6
rjerome commentedI'm not seeing any errors when I import the attached file (see attached image). Could you post another which causes error.
Comment #7
schultz commentedRon... any chance this is an issue with the difference between text files between Macs, PCs and Linux? the file I sent failed on my Mac (with version 1.9 of course). You say it works. When I download the file I had uploaded in the original post, it is filled with return codes and other symbols that suddenly show up on my mac text editor. I wonder if uploading it caused a translation that converted what the Mac uses at the end of lines to something else. Is that possible?
I will upload a new sample file tomorrow. I cannot get any of my bibtex files to work.
Comment #8
rjerome commentedI don't think the file formating would be the problem since these files are parsed character by character as opposed to line by line, but stranger things have happened.
Comment #9
danaktivix commentedFirstly may I say what an absolutely astounding module this is. Yesterday I started to investigate whether I wanted to use Drupal as the basis of my PhD information repository / blog: biblio has totally sold me. I hope I can contribute to the project in the coming months.
On to import: I'm having similar problems. I'm using endnoteweb, the online version. It can export either endnote or bibtex, but not endnote generated XML.
Here's an outline of the problems: I've attached the files that endnoteweb generates for bibtex and endnote formats - is there some reason why they might be a different structure to other versions of the same format, I wonder? (I haven't tried any other versions, so don't know if they work.)
1. Bibtex: authors do not get imported. (This is using dev snapshot 5.x-1.x-dev 2007-Dec-13.)
2. Endote tagged: half works, but does a strange thing - in the current official release, it seems to create an equal number of empty duplicate entries. In the latest development snapshot, it misses the authors out.
3. RIS export from endnoteweb works fine! Awesome.
Cheers,
Dan
p.s. any chance you could send us a rough structure, just some very rough pseudocode, of how you put together this module? It would help folks like me get a toe-hold on starting to help develop it.
Comment #10
rjerome commentedAhhh, the joy of parsing text files...
Both of these items are now fixed.
The EndNote tagged format parser was getting confused by the lines in your "notes" (%Z) fields which only had 1 or 2 characters.
The bibTex parser was upset because your file had no citekey entry which normally follows the entry type...
@article{citekey,
Author = {....}
In terms of structure or flow, the main function is biblio_db_search(), this gets called with no arguments if you enter http://example.com/biblio, it then builds a default query executes pager_query, then calls biblio_show_results with the result from the query. biblio_show_results loops through all the nodes returned from the query, generates the separator bars (be it year or type or whatever) if needed then each entry is sent to theme_biblio_list which calls theme_biblio_short and also adds some other markup, then the final bibliographic formatting is done by the style functions which are called from theme_biblio_short and they are called biblio_style_apa() or whatever the stye is called.
So the flow for a default listing is...
biblio_db_search() -> biblio_show_results() -> theme_biblio_list() -> theme_biblio_short() -> biblio_style_stylename()
Ron.
Comment #11
osopolarI also have import problems (on my mac) for importing bibtex. I wanted to import the bibtex (using the data from #9 danaktivix but also other one) and assign it to a taxonomy term.
I got the message: "exportlist_bibtex.txt was uploaded" and the following warning:
"warning: Invalid argument supplied for foreach() in /...snip../modules/biblio/biblio.module on line 2529."
If I don't assign the term I don't get the warning, but biblio isn't creating the entries (nodes). The same happens with EndNote7 file which I exported from http://liiscience.org/biblio.
Comment #12
osopolarI forgot, I'm using the last dev version.
Comment #13
catdevrandom commented