From 00ca052ce22b46bcf0fea05bbc969d9e5c3298c0 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 30 Sep 2024 10:08:44 +0000 Subject: [PATCH] Bug 35570: (QA follow-up): Standard backend: Biblio creation: Add UNIMARC support Add FreeForm UNIMARC enhancement from https://github.com/PTFS-Europe/koha-ill-freeform/commit/5d07c68f8058a9a1f35e3193699605240741ff0c into this work. This is to keep this work up to date with latest FreeForm's work. To test, k-t-d: 1) (Skip if using sandboxes) Start off by ensuring this is a UNIMARC installation, run: $ reset_all_unimarc 2) (Skip if using sandboxes) Apply this bug 35570 3) Create a new Standard ILL request: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm 4) Select type: book, input different values for title+author+isbn (the remaining fields are optional for this test) 5) Put in a cardnumber ('42' is kohaadmin if k-t-d/sandboxes). Select any library. Click 'Create'. 6) You should now see the ILL request details page. Click on the 'Bibliographic record ID' link. 7) Ensure the newly created biblio record has the title+author+isbn from the metadata originally submitted. Raised by Sonia Bouis at KohaCon's 2024 ILL workshop Signed-off-by: Tomas Cohen Arazi --- Koha/ILL/Backend/Standard.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index 95c4eec858b..5aba0eab1fa 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -1166,15 +1166,15 @@ sub _standard_request2biblio { } if ($isbn) { - my $marc_isbn = MARC::Field->new( '020', '', '', a => $isbn ); + my $marc_isbn = $marcflavour eq 'MARC21' ? MARC::Field->new( '020', '', '', a => $isbn ) : MARC::Field->new( '010', '', '', a => $isbn ); $record->append_fields($marc_isbn); } if ($author) { - my $marc_author = MARC::Field->new( '100', '1', '', a => $author ); + my $marc_author = $marcflavour eq 'MARC21' ? MARC::Field->new( '100', '1', '', a => $author ) : MARC::Field->new( '700', '1', '', a => $author ); $record->append_fields($marc_author); } if ($title) { - my $marc_title = MARC::Field->new( '245', '0', '0', a => $title ); + my $marc_title = $marcflavour eq 'MARC21' ? MARC::Field->new( '245', '0', '0', a => $title ) : MARC::Field->new( '200', '0', '0', a => $title ); $record->append_fields($marc_title); } -- 2.47.0