Bugzilla – Attachment 181657 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.26 KB, created by
Nick Clemens (kidclamp)
on 2025-04-29 13:20:13 UTC
(
hide
)
Description:
Bug 39752: Check for biblio existence when matches are found
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-04-29 13:20:13 UTC
Size:
2.26 KB
patch
obsolete
>From 3ca355df8bfb07fbe1af6cb1255a076de6e8d2c0 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 > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > 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.39.5
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