Bugzilla – Attachment 164864 Details for
Bug 36577
(bug 34478 follow-up) marc21_linking_section.pl not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36577: (bug 34478 follow-up) marc21_linking_section.pl not working
Bug-36577-bug-34478-follow-up-marc21linkingsection.patch (text/plain), 5.87 KB, created by
Janusz Kaczmarek
on 2024-04-12 20:15:20 UTC
(
hide
)
Description:
Bug 36577: (bug 34478 follow-up) marc21_linking_section.pl not working
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-04-12 20:15:20 UTC
Size:
5.87 KB
patch
obsolete
>From 0cd69908aef3e4fdb6b4810c53e701b9f38bc6a4 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Thu, 11 Apr 2024 12:36:25 +0000 >Subject: [PATCH] Bug 36577: (bug 34478 follow-up) marc21_linking_section.pl > not working > >After applying "Bug 34478: op =~ ^cud- everywhere" the plugin >marc21_linking_section.pl stopped working properly. Since the plugin >does not perform a CUD operation, the GET request can be used, and so >the use of CSRF token is not needed. > >The patch fixes also problems with result page numbers display. > >Test plan >========= >1. Configure a MARC bibliographic framework to use the plugin > marc21_linking_section.pl (e.g. in 773 $t). >2. Start creating a new record and go to 773 $t. Activate the plugin to find > the any record to become the host record (perform a search for any > common word, like 'and'). >3. You will get no results. >4. Apply the patch, restart plack etc. >5. Repeat p. 2 - you should now see some results, possibly more than one > page. You should be able to change page with Next/Previous arrows and > also with the page numbers. > >BTW, QA people - maybe it would pay to remove the commented code present there >since the very beginning (2012). >--- > cataloguing/value_builder/marc21_linking_section.pl | 4 ++-- > .../cataloguing/value_builder/marc21_linking_section.tt | 9 ++++----- > 2 files changed, 6 insertions(+), 7 deletions(-) > >diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl >index 04d7d342e3..0bb391ccf0 100755 >--- a/cataloguing/value_builder/marc21_linking_section.pl >+++ b/cataloguing/value_builder/marc21_linking_section.pl >@@ -234,8 +234,8 @@ my $launcher = sub { > > my @numbers = (); > >- if ( $total > $resultsperpage ) { >- for ( my $i = 1 ; $i < $total / $resultsperpage + 1 ; $i++ ) { >+ if ( $total_hits > $resultsperpage ) { >+ for ( my $i = 1 ; $i < $total_hits / $resultsperpage + 1 ; $i++ ) { > if ( $i < 16 ) { > my $highlight = 0; > ( $startfrom == ( $i - 1 ) ) && ( $highlight = 1 ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt >index 0ba8002bea..800c81a240 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt >@@ -21,14 +21,13 @@ > [% IF ( Search ) %] > <div id="MARC21_Linking_section_search" class="page-section"> > <h2>Search for</h2> >- <form name="f" method="post" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl"> >- [% INCLUDE 'csrf-token.inc' %] >+ <form name="f" method="get" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl"> > > <p> > <input type="hidden" name="plugin_name" value="marc21_linking_section.pl" /> > <input type="hidden" name="index" value="[% index | html %]" /> > <input type="hidden" name="result" value="marc12 field 7 [% index | html %]" /> >- <input type="hidden" name="op" value="cud-do_search" /> >+ <input type="hidden" name="op" value="do_search" /> > <label class="label100" for="searchbox">Any word</label> > <input type="text" name="search" id="searchbox" size="35" /><br /> > <label for="itypeloop">Item type</label> >@@ -53,7 +52,7 @@ > <p>[% IF ( displayprev ) %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index | html %]&startfrom=[% startfromprev | html %]&search=[% search | html %]&resultsperpage=[% resultsperpage | html %]&type=intranet&op=do_search"><< Previous</a>[% END %] > [% FOREACH number IN numbers %] > [% IF ( number.highlight ) %] <span class="highlight">[% number.number | html %]</span> >- [% ELSE %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index | html %]&startfrom=[% number.startfrom | html %]&search=[% number.search |url %]&resultsperpage=[% number.resultsperpage | html %]&type=intranet&op=do_search">[% number.number | html %]</a> >+ [% ELSE %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index | html %]&startfrom=[% number.startfrom | html %]&search=[% search |url %]&resultsperpage=[% resultsperpage | html %]&type=intranet&op=do_search">[% number.number | html %]</a> > [% END %] > [% END %] > [% IF ( displaynext ) %] >@@ -114,7 +113,7 @@ > [% number.number | html %] > </span> > [% ELSE %] >- <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index | html %]&startfrom=[% number.startfrom | html %]&search=[% number.search | html %]&resultsperpage=[% number.resultsperpage | html %]&type=intranet&op=do_search"> >+ <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index | html %]&startfrom=[% number.startfrom | html %]&search=[% search | html %]&resultsperpage=[% resultsperpage | html %]&type=intranet&op=do_search"> > [% number.number | html %] > </a> > [% END %] >-- >2.30.2
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 36577
:
164683
|
164864
|
164867
|
165026