Bugzilla – Attachment 179013 Details for
Bug 26869
Enable batch record modification to create items on existing bibs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26869: Add items from MARC in BatchUpdateBiblio
Bug-26869-Add-items-from-MARC-in-BatchUpdateBiblio.patch (text/plain), 3.15 KB, created by
Martin Renvoize (ashimema)
on 2025-03-06 13:30:14 UTC
(
hide
)
Description:
Bug 26869: Add items from MARC in BatchUpdateBiblio
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-06 13:30:14 UTC
Size:
3.15 KB
patch
obsolete
>From 173e80ddcdce5b22a30b156efa1592278f37ec74 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 22 Feb 2024 15:00:09 +0000 >Subject: [PATCH] Bug 26869: Add items from MARC in BatchUpdateBiblio > >Test plan, clean k-t-d: > >Before test, pick a record and confirm it has no items, for this test we're using biblio 79: ><staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=79 > >1) Add a new MARC modification template, visit: ><staff_url>/cgi-bin/koha/tools/marc_modification_templates.pl >2) Click 'New template', enter a name and click 'Submit' >3) Click 'New action' >4) Pick 'Add new' and enter '952' as field and 'a' as subfield, enter 'CPL' as value >5) Click 'Add action' >6) Do a batch record modification, visit: ><staff_url>/cgi-bin/koha/tools/batch_record_modification.pl >7) Select the tab 'Enter a list of record numbers' and enter '79' >8) On the template, select the template previously created. Click 'continue' >9) Click 'Modify selected records'. Click 'View detail of the enqueued job'. Notice success message is shown with no errors >10) Check the biblio, visit: ><staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=79 >11) Notice it now has an item with homebranch 'CPL' > >test with 952 but with other subfields, without subfield 'a' -> confirm 'FK constraint' error is shown, no modification made >test with more than one occurrence of 952$a -> confirm 'FK constraint' error is shown, no modification made >test with 952$a too long e.g. 'aaaaaaaa' -> confirm 'too long' error is shown >test with no 952 mapping -> confirm things work as intended >test with 952 mapping plus other tags -> confirm things work as intended > >prove koha/t/db_dependent/Koha/BackgroundJobs/BatchUpdateBiblio.t >prove koha/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblio.t > >Signed-off by: Chris Rowlands <chris.rowlands6@nhs.net> >Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/BackgroundJob/BatchUpdateBiblio.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm >index af98fe0eb26..4381a0926eb 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblio.pm >+++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm >@@ -24,6 +24,7 @@ use Koha::SearchEngine::Indexer; > > use C4::Context; > use C4::Biblio; >+use C4::Items; > use C4::MarcModificationTemplates; > > use base 'Koha::BackgroundJob'; >@@ -85,7 +86,10 @@ RECORD_IDS: for my $biblionumber ( sort { $a <=> $b } @record_ids ) { > my $biblio = Koha::Biblios->find($biblionumber); > my $record = $biblio->metadata->record; > C4::MarcModificationTemplates::ModifyRecordWithTemplate( $mmtid, $record ); >- my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); >+ my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); >+ my $biblioitemnumber = $biblio->biblioitem->biblioitemnumber; >+ C4::Items::AddItemFromMarc( $record, $biblionumber, { biblioitemnumber => $biblioitemnumber } ); >+ > C4::Biblio::ModBiblio( > $record, > $biblionumber, >-- >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 26869
:
112687
|
162383
|
162387
|
162388
|
166541
|
167312
|
170305
|
170306
|
176397
|
176398
| 179013 |
179014
|
179015
|
179016