Bugzilla – Attachment 178349 Details for
Bug 20551
Add option for including deleted records in export_records.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20551: Fetch deleted biblios through _get_record_export
Bug-20551-Fetch-deleted-biblios-through-getrecorde.patch (text/plain), 2.94 KB, created by
Arthur Suzuki
on 2025-02-19 15:00:07 UTC
(
hide
)
Description:
Bug 20551: Fetch deleted biblios through _get_record_export
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2025-02-19 15:00:07 UTC
Size:
2.94 KB
patch
obsolete
>From 7abb2bf0c764d066e2055964bdc3c283ca9c8d5a Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Mon, 4 Apr 2022 15:08:43 +0200 >Subject: [PATCH] Bug 20551: Fetch deleted biblios through _get_record_export > >--- > Koha/Exporter/Record.pm | 17 +++++++++++------ > misc/export_records.pl | 3 +++ > 2 files changed, 14 insertions(+), 6 deletions(-) > >diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm >index 388da6f2e2d..b143da4b0ca 100644 >--- a/Koha/Exporter/Record.pm >+++ b/Koha/Exporter/Record.pm >@@ -31,11 +31,13 @@ sub _get_record_for_export { > $record = _get_authority_for_export( { %$params, authid => $record_id } ); > } elsif ( $record_type eq 'bibs' ) { > $record = _get_biblio_for_export( { %$params, biblionumber => $record_id } ); >+ } elsif ( $record_type eq 'deleted_bibs' ) { >+ $record = _get_deleted_biblio_for_export( { %$params, biblionumber => $record_id } ); > } else { >- Koha::Logger->get->warn("Record_type $record_type not supported."); >+ Koha::Logger->get->warn("Record type $record_type not supported."); > } > if ( !$record ) { >- Koha::Logger->get->warn("Record $record_id could not be exported."); >+ Koha::Logger->get->warn("Record $record_id with record type $record_type could not be exported."); > return; > } > >@@ -211,7 +213,7 @@ sub export { > Koha::Logger->get->warn("No record_type given."); > return; > } >- return unless ( @{$record_ids} || @{$deleted_record_ids} && $format ne 'csv' ); >+ return unless @{$record_ids} || @{$deleted_record_ids} && $format ne 'csv'; > > my $fh; > if ($output_filepath) { >@@ -232,11 +234,14 @@ sub export { > my @deleted_records; > if ( @{$deleted_record_ids} ) { > my $resultset = Koha::Database->new()->schema()->resultset('DeletedbiblioMetadata'); >+ > @deleted_records = map { >- my $record = _get_deleted_biblio_for_export( >+ my $record = _get_record_for_export( > { >- biblionumber => $_, >- resultset => $resultset, >+ %{$params}, >+ record_type => 'deleted_bibs', >+ record_id => $_, >+ resultset => $resultset > } > ); > $record ? $record : (); >diff --git a/misc/export_records.pl b/misc/export_records.pl >index c55db62bce5..b4f1c4967d6 100755 >--- a/misc/export_records.pl >+++ b/misc/export_records.pl >@@ -114,6 +114,9 @@ if ( $include_deleted || $deleted_only ) { > if ( $output_format eq 'csv' ) { > pod2usage(q|Option "--include_deleted" or "--deleted_only" cannot be used with "--format=csv"|); > } >+ if ( !$timestamp ) { >+ pod2usage(q|Option "--include_deleted" or "--deleted_only" must be combined with "--date"|); >+ } > } > > if ( $output_format eq 'csv' and $record_type eq 'auths' ) { >-- >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 20551
:
73916
|
73923
|
75113
|
82843
|
82914
|
82918
|
90184
|
90190
|
90220
|
93619
|
93620
|
93621
|
105403
|
116408
|
116409
|
116410
|
116411
|
123099
|
123101
|
123102
|
125211
|
125212
|
125213
|
125214
|
125215
|
125216
|
128895
|
128896
|
128897
|
128898
|
128899
|
128900
|
132936
|
132937
|
176623
|
176624
|
176625
|
176626
|
176627
|
176628
|
176629
|
176630
|
176631
|
177536
|
178343
|
178344
|
178345
|
178346
|
178347
|
178348
|
178349
|
178350
|
178351
|
178352
|
178353
|
178378
|
178379
|
178575
|
178617
|
178618
|
178619
|
178679
|
178680
|
178681
|
178682
|
179748
|
179749
|
180648
|
180649
|
180650
|
180651
|
180652
|
180653
|
180654
|
180655
|
180656
|
180657
|
180658
|
180659
|
180660
|
180661
|
180662
|
180663
|
180664
|
180665