Bugzilla – Attachment 186354 Details for
Bug 36616
Ability to stop Complex See Reference authority records from being linked to bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36616: Prevent reference headings from being linked to biblio records
Bug-36616-Prevent-reference-headings-from-being-li.patch (text/plain), 5.23 KB, created by
Aleisha Amohia
on 2025-09-11 02:07:01 UTC
(
hide
)
Description:
Bug 36616: Prevent reference headings from being linked to biblio records
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2025-09-11 02:07:01 UTC
Size:
5.23 KB
patch
obsolete
>From f9b2da2b15fe8e02265025410bd36535f877c853 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Sun, 26 May 2024 23:52:53 +0000 >Subject: [PATCH] Bug 36616: Prevent reference headings from being linked to > biblio records > >When the new LinkEstablishedHeadings system preference is enabled, this enhancement will disable the Choose button next to reference authority records in the cataloguing authority plugin search results. Users will still be able to choose established headings, where the 008/09 is set to 'a' or 'f' (established) or '|' (not coded). > >This works for both Zebra and Elasticsearch. > >To test: > >1) Apply patches and install database updates and restart services >2) Go to Koha Administration -> system preferences. Search for LinkEstablishedHeadings. This should be disabled by default (set to 'All headings'). Change to 'Only established headings' and Save. >3) Create a PERSO_NAME authority record. Set the 008/09 to 'b'. >4) Go to Cataloguing and click New record >5) Go to tab 1 and tag 100. Click the plugin editor for 100$a Personal name. >6) Search for your new PERSON_NAME authority record. Confirm it shows in the results but the Choose button is disabled and cannot be clicked. >7) Edit the authority record and set the 008/09 to 'a'. >8) Repeat steps 4-6. This time the Choose button should be possible to click and insert into the biblio record. > >9) If you did the above test plan with Zebra as the search enginge (as set by SearchEngine system preference), test again with Elasticsearch. The steps and outcomes should be the same - you may need to manually rebuild the indexes between changing the 008/09. > >10) Confirm tests pass >- t/db_dependent/AuthoritiesMarc.t > >Sponsored-by: Education Services Australia SCIS >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/AuthoritiesMarc.pm | 7 +++++++ > .../prog/en/modules/authorities/searchresultlist-auth.tt | 6 +++++- > t/db_dependent/AuthoritiesMarc.t | 8 +++++--- > 3 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index dfc07498619..dbbae99ec9e 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1223,6 +1223,13 @@ sub BuildSummary { > direction => $direction, linkage => $linkage > }; > } >+ >+ # determine if established heading >+ my $f008 = $record->field('008'); >+ my $pos09 = $f008 ? substr( $f008->data, 9, 1 ) : ""; >+ if ( $pos09 eq 'a' or $pos09 eq 'f' or $pos09 eq '|' ) { >+ $summary{established} = 1; >+ } > } > $summary{mainentry} = $authorized[0]->{heading}; > $summary{mainmainentry} = $authorized[0]->{hemain}; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >index 363ae676a31..b71a63be647 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >@@ -125,7 +125,11 @@ > <a href="javascript:doauth('[% line.authid | uri %]', '[% index | uri %]', '[% loop.count | uri %]')" title="[% authorized.heading | html %]">[% loop.count | html %]</a> > [% END %] > [% ELSE %] >- <a class="btn btn-xs btn-default" href="javascript:doauth('[% line.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a> >+ [% IF Koha.Preference('LinkEstablishedHeadings') AND !resul.summary.established %] >+ <a class="btn btn-xs btn-default disabled" href="javascript:doauth('[% line.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a> >+ [% ELSE %] >+ <a class="btn btn-xs btn-default" href="javascript:doauth('[% line.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a> >+ [% END %] > [% END %] > </td> > <td >diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t >index e223ddba348..4427c3711a7 100755 >--- a/t/db_dependent/AuthoritiesMarc.t >+++ b/t/db_dependent/AuthoritiesMarc.t >@@ -52,6 +52,7 @@ $module->mock( > } elsif ( $authid eq '2' ) { > $record->add_fields( > [ '001', '2' ], >+ [ '008', '|| aca||aabn | a|a d' ], > [ '151', ' ', ' ', a => 'New York (State)' ], > [ '551', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ], > [ '751', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ], >@@ -196,9 +197,10 @@ my $expected_marc21_summary = { > 'heading' => 'General subdivision' > } > ], >- 'seefrom' => [], >- 'label' => 'Geographic Name', >- 'type' => 'Geographic Name', >+ 'seefrom' => [], >+ 'label' => 'Geographic Name', >+ 'type' => 'Geographic Name', >+ 'established' => '1', > }; > > is_deeply( >-- >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 36616
:
165248
|
165249
|
166033
|
166746
|
166747
|
167185
|
167186
|
167365
|
167366
|
172125
|
186353
| 186354