Bugzilla – Attachment 161875 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.52 KB, created by
Victor Grousset/tuxayo
on 2024-02-08 03:54:00 UTC
(
hide
)
Description:
Bug 31286: Embed see-from headings into bibliographic records export
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-02-08 03:54:00 UTC
Size:
3.52 KB
patch
obsolete
>From dd295166dba267a100c9a14fef03ccff3ece8f2e 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 > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > 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 49c86c8c42..974689eb92 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 051657aa76..1ec3bd8d0f 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); > >@@ -266,6 +268,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, > } > ); > } >@@ -395,6 +398,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.43.0
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