Bugzilla – Attachment 144576 Details for
Bug 32437
When adding to a basket form a staged file and matching the imported records are ignored when set to overwrite
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32437: Honor overlay setting in staged batch when adding to a basket
Bug-32437-Honor-overlay-setting-in-staged-batch-wh.patch (text/plain), 2.85 KB, created by
Nick Clemens (kidclamp)
on 2022-12-14 12:26:12 UTC
(
hide
)
Description:
Bug 32437: Honor overlay setting in staged batch when adding to a basket
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-12-14 12:26:12 UTC
Size:
2.85 KB
patch
obsolete
>From b6dcbe0506c601c1ce5ff7f230fd109348a93bdd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 12 Dec 2022 18:41:28 +0000 >Subject: [PATCH] Bug 32437: Honor overlay setting in staged batch when adding > to a basket > >This patch uses the replace method added in last patch to ensure >records are overlayed when added to a basket > >To test: > 1 - Stage the sample file on this report using the options below > (If not using sample database simply save a record as marc from the details page, then change the title in the interface and import the saved version) > 2 - Make sure to match using KohaBiblio (999c) > 3 - Set option "Replace existing record" if match found > 4 - Once record is staged go to Acquisitions > 5 - Find a vendor and select/create an open basket > 6 - Add to basket from the staged file > 7 - Add order info and save > 8 - Check the record, title is unchanged - Sample file should add 'New and improved!' > 9 - Check the staged records batch - note the diff shows that new record should have overwritten >10 - Apply patch >11 - Stage file, match on KohaBiblio, set action if matching record found to 'Ignore incoming record' >12 - Add to basket from the staged file and save >13 - Confirm record not overlayed when not reuqested >14 - Stage file, match on KohaBiblio, set action if mathc record found to 'Replace existing...' >15 - Add to basket from staged file and save >16 - Confirm the record is updated to 'New and improved!' >--- > acqui/addorderiso2709.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index eefcabcf4a..fb31a8bcee 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -51,6 +51,7 @@ use Koha::Acquisition::Baskets; > use Koha::Acquisition::Currencies; > use Koha::Acquisition::Orders; > use Koha::Acquisition::Booksellers; >+use Koha::ImportBatches; > use Koha::Import::Records; > use Koha::Patrons; > >@@ -135,6 +136,8 @@ if ($op eq ""){ > > # retrieve the file you want to import > my $import_batch_id = $cgiparams->{'import_batch_id'}; >+ my $import_batch = Koha::ImportBatches->find( $import_batch_id ); >+ my $overlay_action = $import_batch->overlay_action; > my $import_records = Koha::Import::Records->search({ > import_batch_id => $import_batch_id, > }); >@@ -171,6 +174,10 @@ if ($op eq ""){ > # Insert the biblio, or find it through matcher > if ( $biblionumber ) { # If matched during staging we can continue > $import_record->status('imported')->store; >+ if( $overlay_action eq 'replace' ){ >+ my $biblio = Koha::Biblios->find( $biblionumber ); >+ $import_record->replace({ biblio => $biblio }); >+ } > } else { # Otherwise we check for duplicates, and skip if they exist > if ($matcher_id) { > if ( $matcher_id eq '_TITLE_AUTHOR_' ) { >-- >2.30.2
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 32437
:
144538
|
144539
|
144540
|
144541
|
144573
|
144574
|
144575
|
144576
|
145223
|
145224
|
145225
|
145226
|
147677
|
147678
|
147679
|
147680
|
147681
|
148270
|
148271
|
148272
|
148273
|
148274
|
148275
|
148276
|
148277
|
148300
|
148301
|
148302
|
148303
|
148304
|
148305
|
148306