Bug 40042 - search_indexes.inc may have undefined index var
Summary: search_indexes.inc may have undefined index var
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Fridolin Somers
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 30699
Blocks:
  Show dependency treegraph
 
Reported: 2025-06-02 08:00 UTC by Fridolin Somers
Modified: 2025-06-22 21:47 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.01
Circulation function:


Attachments
Bug 40042: Add default value 0 for index var in search_indexes.inc (1.59 KB, patch)
2025-06-02 08:07 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 40042: Add default value 0 for index var in search_indexes.inc (1.65 KB, patch)
2025-06-04 10:54 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 40042: Add default value 0 for index var in search_indexes.inc (1.74 KB, patch)
2025-06-06 06:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2025-06-02 08:00:17 UTC
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.
Comment 1 Fridolin Somers 2025-06-02 08:07:44 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2025-06-04 10:54:36 UTC
Created attachment 182938 [details] [review]
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>
Comment 3 Marcel de Rooy 2025-06-06 06:48:38 UTC
Created attachment 183041 [details] [review]
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>
Comment 4 Lucas Gass (lukeg) 2025-06-06 15:46:04 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Paul Derscheid 2025-06-22 21:47:23 UTC
Nice work everyone!

Pushed to 25.05.x for 25.05.03