[Bug 9274] New: Software error in bibtex export
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Bug ID: 9274 Summary: Software error in bibtex export Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: MARC Bibliographic data support Assignee: gmcharlt@gmail.com Reporter: fridolyn.somers@biblibre.com 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |fridolyn.somers@biblibre.co | |m --- Comment #1 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14041 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14041&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- (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). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Please also resubmit your patch with a commit message which describes the problem, describes the solution, and provides a test plan. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14041|0 |1 is obsolete| | --- Comment #4 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14387 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14387&action=edit Proposed patch (commented) Here is my patch with comment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 --- Comment #5 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |gmcharlt@gmail.com --- Comment #6 from Galen Charlton <gmcharlt@gmail.com> --- 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 --- Comment #7 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 14631 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14631&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 --- Comment #8 from Galen Charlton <gmcharlt@gmail.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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |6201 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #9 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- I agree with your patch and will sign it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14387|0 |1 is obsolete| | Attachment #14631|0 |1 is obsolete| | --- Comment #10 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 14693 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14693&action=edit [SIGNED-OFF] Bug 9274: fix BibTex export to use GetMarcAuthors correctly To test, just try Bibtex export from OPAC. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #11 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- 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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 --- Comment #12 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- (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). Maybe someone can use it to add MARC21 specific cases ?
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14693|0 |1 is obsolete| | --- Comment #13 from Fridolyn SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 15527 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15527&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #15527|0 |1 is obsolete| | --- Comment #14 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 15600 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=15600&action=edit [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 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 --- Comment #15 from Owen Leonard <oleonard@myacpl.org> --- I just ran across this issue when testing Bug 6201. This patch resolved the problem. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Fridolyn SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #15600|0 |1 is obsolete| | --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17059 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17059&action=edit [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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #17 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9274 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #18 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x and 3.8.x will be in 3.10.5 and 3.8.12 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org