Bugzilla – Attachment 186052 Details for
Bug 28639
Embed see-from headings (from authorities) into bibliographic records at OAI repository level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28639: Embed see-from headings (from authorities) into bibliographic records at OAI repository level
Bug-28639-Embed-see-from-headings-from-authorities.patch (text/plain), 5.70 KB, created by
OpenFifth Sandboxes
on 2025-09-02 14:45:39 UTC
(
hide
)
Description:
Bug 28639: Embed see-from headings (from authorities) into bibliographic records at OAI repository level
Filename:
MIME Type:
Creator:
OpenFifth Sandboxes
Created:
2025-09-02 14:45:39 UTC
Size:
5.70 KB
patch
obsolete
>From a97caa85c8a4567d60e5cc7ebdf3187a00456f26 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Fri, 21 Oct 2022 09:28:06 +0200 >Subject: [PATCH] Bug 28639: Embed see-from headings (from authorities) into > bibliographic records at OAI repository level > >Test plan: >1. Create an authority with at least a 1XX$a and a 4XX$a, for instance: > 100 $a Foo > 400 $a Bar >2. Create a biblio and add a link to this authority using the > cataloguing plugin >3. Enable OAI-PMH syspref and fill OAI-PMH:archiveID syspref with "oai:sandbox" >4. Go to OAI repository and display the previously created record (at /cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=marcxml&identifier=oai:sandbox:{biblionumber} >5. The record should not contain see-from headings >6. Run perl installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl >7. Enable OAI-PMH:EmbedSeeFromInBibRecord >8. Go again to the OAI record, you should see alternative forms at the end of the record > >Signed-off-by: Mathieu Saby <mathsabypro@gmail.com> >--- > Koha/OAI/Server/Repository.pm | 4 +++- > ...639-add_EmbedSeeFromInBibRecord_syspref.pl | 21 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../admin/preferences/web_services.pref | 6 ++++++ > 4 files changed, 31 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl > >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index 071012299b..9a025a3f00 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/Koha/OAI/Server/Repository.pm >@@ -40,6 +40,7 @@ use C4::Biblio qw( GetFrameworkCode ); > use C4::Charset qw( StripNonXmlChars ); > use Koha::XSLT::Base; > use Koha::Biblios; >+use Koha::Filter::MARC::EmbedSeeFromHeadings; > > use MARC::Record; > >@@ -183,6 +184,7 @@ sub get_biblio_marcxml { > my ( $self, $biblionumber, $format ) = @_; > my $with_items = 0; > my $expanded_avs = 0; >+ my $embedseefromheadings = C4::Context->preference('OAI-PMH:EmbedSeeFromInBibRecord') || 0; > if ( my $conf = $self->{conf} ) { > $with_items = $conf->{format}->{$format}->{include_items}; > $expanded_avs = $conf->{format}->{$format}->{expanded_avs}; >@@ -210,7 +212,7 @@ sub get_biblio_marcxml { > $record = $biblio->metadata->record_strip_nonxml( { embed_items => $with_items, opac => 1 } ); > } > if ($record) { >- >+ Koha::Filter::MARC::EmbedSeeFromHeadings->filter($record) if $embedseefromheadings; > my $rules = C4::Context->yaml_preference('OpacHiddenItems') // {}; > if ( $biblio->hidden_in_opac( { rules => $rules } ) ) { > return; >diff --git a/installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl b/installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl >new file mode 100755 >index 0000000000..4665e24be0 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28639-add_EmbedSeeFromInBibRecord_syspref.pl >@@ -0,0 +1,21 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "bug_28639", >+ description => "Add embed see-from headings for oai", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) >+ VALUES ( >+ 'EmbedSeeFromInBibRecord', '0', NULL, 'Add embed see-from headings for OAI', 'YesNo' >+ ) >+ } >+ ); >+ >+ say $out "Syspref EmbedSeeFromInBibRecord for OAI"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 67cd533daf..3cbec662e0 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -465,6 +465,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OAI-PMH:AutoUpdateSetsEmbedItemData', '0', '', 'Embed item information when automatically updating OAI sets. Requires OAI-PMH:AutoUpdateSets syspref to be enabled', 'YesNo'), > ('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'), > ('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent), might be deleted (transient), or will never have any data in it (no)','transient|persistent|no','Choice'), >+('OAI-PMH:EmbedSeeFromInBibRecord','0','','Embed see-from headings in bibliographic records exposed through OAI repository.','YesNo'), > ('OAI-PMH:HarvestEmailReport','','','After an OAI-PMH harvest, send a report email to the email address','Free'), > ('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'), > ('OnSiteCheckoutAutoCheck','0','','Enable/Do not enable onsite checkout by default if last checkout was an onsite checkout','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >index a1900bc746..d9d6b7d8bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >@@ -97,6 +97,12 @@ Web services: > class: Text > - . > >+ - >+ - pref: "OAI-PMH:EmbedSeeFromInBibRecord" >+ choices: >+ 1: Enable >+ 0: "Don't enabled" >+ - "Embed <em>see from</em> (non-preferred form) headings in bibliographic records exposed through OAI repository." > ILS-DI: > - > - pref: ILS-DI >-- >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 28639
:
122500
|
142296
|
142297
|
144821
|
144822
|
144857
|
171973
|
171974
|
171975
|
186023
|
186024
|
186025
|
186026
| 186052 |
186053
|
186054
|
186055