Bug 40306: Use GET in form of value_builder/unimarc_field_4XX.pl

Since CSRF procetion form without CUD action must use GET instead of POST
Fix value_builder/unimarc_field_4XX.pl

Test plan:
1) Use UNIMARC DB
2) Be sure value builder unimarc_field_4XX.pl is defined on 461$t
3) Create a new biblio record
4) On 461$t click on 'Tag editor' icon
5) Perform a search
6) Click on choose
7) Field 461 is filled

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
Fridolin Somers 2025-07-04 13:50:45 +02:00 committed by Martin Renvoize
parent d210db0e6b
commit 3b4db6dba6
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
2 changed files with 6 additions and 8 deletions

View File

@ -395,8 +395,8 @@ sub plugin {
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 );

View File

@ -19,14 +19,12 @@
[% IF ( Search ) %]
<div id="UNIMARC_Field_4XX_search" class="page-section">
<h2> Search on </h2>
<form name="f" method="post" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl">
[% INCLUDE 'csrf-token.inc' %]
<form name="f" method="get" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl">
<p>
<input type="hidden" name="plugin_name" value="unimarc_field_4XX.pl" />
<input type="hidden" name="index" value="[% index | html %]" />
<input type="hidden" name="result" value="unimarc field 4 [% 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>
@ -59,7 +57,7 @@
[% ELSE %]
<a
class="resultnumber"
href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% number.search |uri %]&amp;resultsperpage=[% number.resultsperpage | html %]&amp;type=intranet&amp;op=do_search"
href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% search |uri %]&amp;resultsperpage=[% resultsperpage | html %]&amp;type=intranet&amp;op=do_search"
>[% number.number | html %]</a
>
[% END %]
@ -152,7 +150,7 @@
[% ELSE %]
<a
class="resultnumber"
href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% number.search |uri %]&amp;resultsperpage=[% number.resultsperpage | html %]&amp;type=intranet&amp;op=do_search"
href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&amp;index=[% index | html %]&amp;startfrom=[% number.startfrom | html %]&amp;search=[% search |uri %]&amp;resultsperpage=[% resultsperpage | html %]&amp;type=intranet&amp;op=do_search"
>
[% number.number | html %]
</a>