Bug 40042: Add default value 0 for index var in search_indexes.inc

In koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc some calls do not set 'index' var generating idx="idx_".
Set 0 has default value.

Test plan :
1) Enable system preference 'IntranetCatalogSearchPulldown'
2) Go to catalogue advanced search
3) Look HTML source and check you see:
     <select class="advsearch" name="idx" id="idx_0">
     <select class="advsearch" name="idx" id="idx_1">
     <select class="advsearch" name="idx" id="idx_2">
4) In page page toolbar, click 'Search catalog'
5) Click on 'More options' icon
6) Look HTML source of this part and check you see:
      <select class="advsearch" name="idx" id="idx_0">
Without patch you see:
      <select class="advsearch" name="idx" id="idx_">

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0d39336f71)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Fridolin Somers 2025-06-02 10:00:32 +02:00 committed by Paul Derscheid
parent d99a9e28b6
commit eb9da8a8d6
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,7 @@
[% USE Koha %] [% USE Koha %]
[% UNLESS index %]
[% SET index = 0 %]
[% END %]
[% SET select_id = refiner ? 'refiner_idx_' _ index : 'idx_' _ index %] [% SET select_id = refiner ? 'refiner_idx_' _ index : 'idx_' _ index %]
<select class="advsearch" name="idx" id="[% select_id | html %]"> <select class="advsearch" name="idx" id="[% select_id | html %]">
[% IF ms_kw %] [% IF ms_kw %]