Bug 35975

Summary: Downloaded cart with BibTeX contains hash value instead of the record number
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: OPACAssignee: Lari Taskula <lari.taskula>
Status: Pushed to stable --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: david, lari.taskula
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36336
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes the contents of the BibTeX file downloaded from an OPAC cart - it now correctly shows the record number, instead of Koha::Hash(xxx). Example of incorrect BibTeX file format: @book{Koha::Biblio=HASH(0x560e89ade4b8), <--- should have been 262 author = {Christiansen, Tom. and Foy, Brian D.}, title = {Programming Perl /}, publisher = {O'Reilly,}, year = {c2012.}, address = {Beijing ;}, edition = {4th ed.}, note = {Rev. ed. of: Programming Perl / Larry Wall, Tom Christiansen & Jon Orwant. 2000. 3rd ed.} }
Version(s) released in:
25.05.00,24.11.03
Circulation function:
Attachments: Bug 35975: Show biblionumber when download cart as BibTeX
Bug 35975: Show biblionumber when download cart as BibTeX

Description Marcel de Rooy 2024-02-01 13:43:55 UTC
@book{Koha::Biblio=HASH(0x560e89ade4b8),
	author = {Schwartz, Randal L. and Phoenix, Tom},
	title = {Learning Perl /},
etc
Comment 1 Katrin Fischer 2024-03-17 16:56:50 UTC
Can't really test, because it seems almost all export options now result in an error 500:
Bug 36336 - Exporting records from detail page is broken
Comment 2 Lari Taskula 2024-12-19 10:16:20 UTC
I also noticed this. C4::Record::marc2bibtex($marc_record, $biblionumber) second parameter expects a biblionumber. opac-downloadcart.pl is passing it a Koha::Biblio.
Comment 3 Lari Taskula 2024-12-19 11:00:51 UTC
Created attachment 175698 [details] [review]
Bug 35975: Show biblionumber when download cart as BibTeX

To test:
1. In OPAC, add a record to your cart
2. Go to your cart
3. Click Download -> BibTeX
4. Observe downloaded file in your favorite text editor
5. Observe Koha::Hash(xxx) within file contents
6. Apply patch
7. Repeat steps 3 and 4
8. Observe Koha::Hash has been replaced with biblionumber
Comment 4 Owen Leonard 2024-12-19 12:25:49 UTC
Created attachment 175720 [details] [review]
Bug 35975: Show biblionumber when download cart as BibTeX

To test:
1. In OPAC, add a record to your cart
2. Go to your cart
3. Click Download -> BibTeX
4. Observe downloaded file in your favorite text editor
5. Observe Koha::Hash(xxx) within file contents
6. Apply patch
7. Repeat steps 3 and 4
8. Observe Koha::Hash has been replaced with biblionumber

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Katrin Fischer 2024-12-27 16:07:03 UTC
QA by RM.

Also checked the staff interface: the error didn't exist there.
Comment 6 Katrin Fischer 2024-12-27 16:36:08 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 7 Paul Derscheid 2025-03-19 23:00:16 UTC
Nice work everyone!

Pushed to 24.11.x for 24.11.03