Bugzilla – Attachment 148913 Details for
Bug 32800
build_oai_sets.pl fails on deleted records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32800: Don't embed items for deleted records
Bug-32800-Dont-embed-items-for-deleted-records.patch (text/plain), 1.61 KB, created by
Nick Clemens (kidclamp)
on 2023-03-29 13:03:15 UTC
(
hide
)
Description:
Bug 32800: Don't embed items for deleted records
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-29 13:03:15 UTC
Size:
1.61 KB
patch
obsolete
>From c8102bd7c0030feccc9add1ce0453a2e02f4f42f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 2 Feb 2023 15:58:10 +0000 >Subject: [PATCH] Bug 32800: Don't embed items for deleted records > >To test: >1 - Delete a biblio >2 - perl /kohadevbox/koha/misc/migration_tools/build_oai_sets.pl -v -i -r >3 - Error: > Can't call method "items" on an undefined value at /kohadevbox/koha/Koha/Biblio/Metadata.pm line 163. >4 - Apply patch >5 - Repeat >6 - Success! >--- > misc/migration_tools/build_oai_sets.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/misc/migration_tools/build_oai_sets.pl b/misc/migration_tools/build_oai_sets.pl >index 0ab07bcd91..a312d3e0f9 100755 >--- a/misc/migration_tools/build_oai_sets.pl >+++ b/misc/migration_tools/build_oai_sets.pl >@@ -79,12 +79,12 @@ my $mappings = GetOAISetsMappings; > # Get all biblionumbers and marcxml > print "Retrieving biblios... " if $verbose; > my $query = qq{ >- SELECT biblionumber, metadata >+ SELECT biblionumber, metadata, 0 as "deleted" > FROM biblio_metadata > WHERE format='marcxml' > AND `schema` = ? > UNION >- SELECT biblionumber, metadata >+ SELECT biblionumber, metadata, 1 as "deleted" > FROM deletedbiblio_metadata > WHERE format='marcxml' > AND `schema` = ? >@@ -140,7 +140,7 @@ foreach my $res (@$results) { > warn "(biblio $biblionumber) Error while creating record from marcxml: $@"; > next; > } >- if($embed_items) { >+ if( $embed_items && !($res->{'deleted'}) ) { > $record = Koha::Biblio::Metadata->record( > { > record => $record, >-- >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 32800
:
146016
|
148913
|
148914
|
149408