Bugzilla – Attachment 181576 Details for
Bug 39752
Koha MarcOrder does not verify bibliographic record exists when adding order and items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39752: Check for biblio existence when matches are found
Bug-39752-Check-for-biblio-existence-when-matches-.patch (text/plain), 2.16 KB, created by
Matt Blenkinsop
on 2025-04-28 08:51:32 UTC
(
hide
)
Description:
Bug 39752: Check for biblio existence when matches are found
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-04-28 08:51:32 UTC
Size:
2.16 KB
patch
obsolete
>From 3a4fb7c1e3642286af6ec384d508855d1223f07a Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Mon, 28 Apr 2025 09:44:48 +0100 >Subject: [PATCH] Bug 39752: Check for biblio existence when matches are found > >Currently when adding to a basket from a new/staged file, we don't check whether a matched record still exists when importing. This patch changes the conditional check to be based on the existence of the biblio record rather than just on the biblionumber from the match > >Test plan: >1) Stage and import a record into Koha >2) Stage the same record again, this time matching on ISBN >3) Check that the match has been found in the batch details >4) Delete the original record that you imported in step 1 >5) Find a basket, and add to it from a staged file >6) Choose the file/record you imported in stage 2 >7) Select the record and save to add the orders >8) You will get a 500 error >9) Apply patch and restart_all >10) Refresh the page to re-submit the form >11) The form should submit correctly >--- > Koha/MarcOrder.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/MarcOrder.pm b/Koha/MarcOrder.pm >index 6cb39fa4377..e58cc5634a2 100644 >--- a/Koha/MarcOrder.pm >+++ b/Koha/MarcOrder.pm >@@ -395,13 +395,13 @@ sub add_biblio_from_import_record { > > my $marcrecord = $import_record->get_marc_record || die "Couldn't translate MARC information"; > my $matches = $import_record->get_import_record_matches( { chosen => 1 } ); >- my $match = $matches->count ? $matches->next : undef; >- my $biblionumber = $match ? $match->candidate_match_id : 0; >+ my $match = $matches->count ? $matches->next : undef; >+ my $biblionumber = $match ? $match->candidate_match_id : 0; >+ my $biblio = $biblionumber ? Koha::Biblios->find($biblionumber) : undef; > >- if ($biblionumber) { >+ if ($biblio) { > $import_record->status('imported')->store; > if ( $overlay_action eq 'replace' ) { >- my $biblio = Koha::Biblios->find($biblionumber); > $import_record->replace( { biblio => $biblio } ); > } > } else { >-- >2.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39752
:
181576
|
181639
|
181656
|
181657