Export filehandle bug

  • Barry Rowlingson

    There's a problem with the export_* functions in the refbase bibutils directory. They write out the temporary file, and then call the bibutils function _before_ closing the filehandle. In many cases the output isn't flushed and so xml2bib sees no data. Solution is to do the fclose as soon as you've written the file:

                   $tempFileHandle = fopen($tempFile, "w"); // open temp file with write permission
                    fwrite($tempFileHandle, $recordCollection); // save data to temp file
                    fclose($tempFileHandle); // close temp file

    In fact the three files export_xml2{bib,end,ris}.php are so similar they should be restructured!

    Anyway, they all have the same bug.

    The symptom is that you see a blank page when you export a record to a citation format.

    • Matthias Steffens

      Hi Barry,

      the problem you're describing was also mentioned by 'unfimaer' in the following thread:


      and I've fixed it already in the CVS version and it will thus be fixed in the next release version as well.

      I agree that some code in the three files is redundant and should be moved into a dedicated function. However, the current implementation requires that each export format resides in its own file and I actually think that this is a good thing.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks