When trying to export a biblio or a basket in bibtext, you get a broken page : "Software error: Can't use string ("13057") as an ARRAY ref while "strict refs" in use at /home/koha/src/C4/Record.pm line 654.
Created attachment 14041 [details] [review] Proposed patch Problem comes from the call at C4::Biblio::GetMarcAuthors. I removed this call since it is deigned for Koha display. I replaced by a direct read of MARC::Record, like for other BibTex datas. BibTex Authors are displayed : <first name> <last name> and ... I read it in http://www.tuteurs.ens.fr/logiciels/latex/bibtex.html
(In reply to comment #1) > Problem comes from the call at C4::Biblio::GetMarcAuthors. Hi Fridolyn, Could you explain more precisely the reason why please? Your patch duplicates some information (mintag and maxtag are already defined in GetMarcAuthors).
Please also resubmit your patch with a commit message which describes the problem, describes the solution, and provides a test plan.
Created attachment 14387 [details] [review] Proposed patch (commented) Here is my patch with comment.
Has explained in patch comment : Exporting to Bibtex from OPAC returns a software error. This is because call to C4::Biblio::GetMarcAuthors does not return only authors but also authority link. This patch replaces this call by a direct read of MARC::Record, like for other Bibtex datas. C4::Biblio::GetMarcAuthors is really destinated to a direct use in a template. Also, actually all author subfields are joined with 'and'. According to Bibtext format, authors sould be : <first name> <last name> and ... Feel free to ask more details.
I'm a little hesitant about the code duplication, but I agree that GetMarcAuthors isn't suitable (even with the crash put aside). However, the way that names are constructed isn't quite right for MARC21, as the 700$b is *not* the first name, it's numeration associated with the name (e.g., John Doe III), and consequently should not precede the contents of $a.
Created attachment 14631 [details] [review] Bug 9274: fix BibTex export to use GetMarcAuthors correctly This is a proposed patch that simply fixes the crash without changing behavior. Signed-off-by: Galen Charlton <gmc@esilibrary.com>
I've attached a counter-patch that simply avoids the crash without changing behavior. If we decide to change how MARC is translated to BibTex, we may as well work on bug 6201 as well.
I agree with your patch and will sign it.
Created attachment 14693 [details] [review] [SIGNED-OFF] Bug 9274: fix BibTex export to use GetMarcAuthors correctly To test, just try Bibtex export from OPAC.
The patches fixes the problem with several authors. So, no crash. That is great! But if the marc fields include more information than the name in $a, they are attached as well in the string. For instance a 700$a with a name and a 700$4 with a relator code sht (supporting host?), make this as author name (marc21): author = "Bohlmann, Carolin and Museumslandschaft Hessen Kassel and Museum Schloss Wilhelmshöhe and sht" The part "and sht" comes from the $4 and should not be included. The results from GetMarcAuthors need one more level of "grepping" on code equals $a. In my view this report could address that now too. I do not feel that this report should also address the "who is an author" discussion here. But note that not everybody in 7XX will be an author. In my testcase above Carolin is author, the second 700 is editor and the third is the host for the exhibition (the book is the exhibition catalog). But as said, we leave the scope of this report now. Note that this patch is marked trivial (one line), but reading multiple maps and greps on one line is certainly not that trivial :) Could you please send a correction or followup? Failed QA
(In reply to comment #11) > The patches fixes the problem with several authors. So, no crash. That is > great! > But if the marc fields include more information than the name in $a, they > are attached as well in the string. That is why I didn't use C4::Biblio::GetMarcAuthors in my first patch (attachment 14387 [details] [review]). Maybe someone can use it to add MARC21 specific cases ?
Created attachment 15527 [details] [review] Proposed patch (revisited) I have revised patch with one of my colleagues aware of MARC flavours to add non-UNIMARC behavior for authors. See commit message.
Created attachment 15600 [details] [review] [SIGNED-OFF] Bug 9274: Software error in bibtex export Exporting to Bibtex from OPAC returns a software error. This is because call to C4::Biblio::GetMarcAuthors does not return only authors but also authority link. This patch replaces this call by a direct read of MARC::Record, like for other Bibtex datas. C4::Biblio::GetMarcAuthors is really destinated to a direct use in a template. Also, actually all author subfields are joined with 'and'. According to Bibtext format, authors should be "firstname surname and ..." or "surname, firstname and ...". I have choosen second one because in non-UNIMARC it corresponds to $a content. For example UNIMARC : 700 $aDoe $bJohn 700 $aDoe $bJanne Gives : Doe, John and Doe, Janne For example MARC21 : 700 $aDoe, John 700 $aDoe, Janne Gives : Doe, John and Doe, Janne Test plan : Without patch : Exporting to Bibtex from OPAC returns a software error. With patch : Exporting to Bibtex from OPAC succeeds. Authors are composed using : $a, $b and ... for UNIMARC, $a ... for other marc flavours. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works as decribed. All record export that produces error pre-patch, now export without error. No koha-qa errors
I just ran across this issue when testing Bug 6201. This patch resolved the problem.
Created attachment 17059 [details] [review] [PASSED QA] Bug 9274: Software error in bibtex export Exporting to Bibtex from OPAC returns a software error. This is because call to C4::Biblio::GetMarcAuthors does not return only authors but also authority link. This patch replaces this call by a direct read of MARC::Record, like for other Bibtex datas. C4::Biblio::GetMarcAuthors is really destinated to a direct use in a template. Also, actually all author subfields are joined with 'and'. According to Bibtext format, authors should be "firstname surname and ..." or "surname, firstname and ...". I have choosen second one because in non-UNIMARC it corresponds to $a content. For example UNIMARC : 700 $aDoe $bJohn 700 $aDoe $bJanne Gives : Doe, John and Doe, Janne For example MARC21 : 700 $aDoe, John 700 $aDoe, Janne Gives : Doe, John and Doe, Janne Test plan : Without patch : Exporting to Bibtex from OPAC returns a software error. With patch : Exporting to Bibtex from OPAC succeeds. Authors are composed using : $a, $b and ... for UNIMARC, $a ... for other marc flavours. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comment: Works as decribed. All record export that produces error pre-patch, now export without error. No koha-qa errors Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Fixes error and output of additional authors. Main entry in 100 is still missing. All tests and QA script pass.
This patch has been pushed to master.
Pushed to 3.10.x and 3.8.x will be in 3.10.5 and 3.8.12