Bugzilla – Attachment 138520 Details for
Bug 31286
Embed see-from headings into bibliographic records export
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31286: Embed see-from headings into bibliographic records export
Bug-31286-Embed-see-from-headings-into-bibliograph.patch (text/plain), 3.41 KB, created by
Fridolin Somers
on 2022-08-03 01:31:59 UTC
(
hide
)
Description:
Bug 31286: Embed see-from headings into bibliographic records export
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-08-03 01:31:59 UTC
Size:
3.41 KB
patch
obsolete
>From 12e7f49b1d90da37a5b3b860627e87f349d3b98e Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 2 Aug 2022 15:17:25 -1000 >Subject: [PATCH] Bug 31286: Embed see-from headings into bibliographic records > export > >In misc/export_records.pl add an option to add see-from headings (from authorities 4xx) into bibliographic records export. >Like it is done during record indexing. > >Test plan : >1) Choose a biblio record having a field (for example 650) linked to an authority with a see-form. >2) Export this record without see-from headings : > misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_without.xml --format xml >3) Export this record with see-from headings : > misc/export_records.pl --starting_biblionumber=X --ending_biblionumber=X --filename /tmp/record_with.xml --format xml --embed_see_from_headings >4) Compare /tmp/record_without.xml and /tmp/record_with.xml >=> you should see two 650, one with main heading and one with see-from heading >--- > Koha/Exporter/Record.pm | 7 +++++++ > misc/export_records.pl | 7 +++++++ > 2 files changed, 14 insertions(+) > >diff --git a/Koha/Exporter/Record.pm b/Koha/Exporter/Record.pm >index e678c36ee1..c2dfc38c2f 100644 >--- a/Koha/Exporter/Record.pm >+++ b/Koha/Exporter/Record.pm >@@ -10,6 +10,7 @@ use C4::Record; > use Koha::Biblios; > use Koha::CsvProfiles; > use Koha::Logger; >+use Koha::RecordProcessor; > use List::Util qw( all any ); > > sub _get_record_for_export { >@@ -120,12 +121,18 @@ sub _get_biblio_for_export { > my $itemnumbers = $params->{itemnumbers}; > my $export_items = $params->{export_items} // 1; > my $only_export_items_for_branches = $params->{only_export_items_for_branches}; >+ my $embed_see_from_headings = $params->{embed_see_from_headings}; > > my $biblio = Koha::Biblios->find($biblionumber); > my $record = eval { $biblio->metadata->record }; > > return if $@ or not defined $record; > >+ if ($embed_see_from_headings) { >+ my $record_processor = Koha::RecordProcessor->new( { filters => 'EmbedSeeFromHeadings' } ); >+ $record_processor->process($record); >+ } >+ > if ($export_items) { > Koha::Biblio::Metadata->record( > { >diff --git a/misc/export_records.pl b/misc/export_records.pl >index 32658cb8c8..08aba2d7e6 100755 >--- a/misc/export_records.pl >+++ b/misc/export_records.pl >@@ -54,6 +54,7 @@ my ( > $start_accession, > $end_accession, > $marc_conditions, >+ $embed_see_from_headings, > $help > ); > >@@ -78,6 +79,7 @@ GetOptions( > 'start_accession=s' => \$start_accession, > 'end_accession=s' => \$end_accession, > 'marc_conditions=s' => \$marc_conditions, >+ 'embed_see_from_headings' => \$embed_see_from_headings, > 'h|help|?' => \$help > ) || pod2usage(1); > >@@ -256,6 +258,7 @@ else { > csv_profile_id => $csv_profile_id, > export_items => (not $dont_export_items), > clean => $clean || 0, >+ embed_see_from_headings => $embed_see_from_headings || 0, > } > ); > } >@@ -385,6 +388,10 @@ Print a brief help message. > "exists(<marc_target>)" will include marc records where > no <marc_target> exists. > >+=item B<--embed_see_from_headings> >+ >+ --embed_see_from_headings Embed see from (non-preferred form) headings in bibliographic record. >+ > =back > > =head1 AUTHOR >-- >2.35.4
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 31286
:
138520
|
160672
|
161875
|
161876