Bug 31271

Summary: "Edit search" always resets search options to keyword
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Staff interfaceAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: bwsdonna, gmcharlt, jonathan.druart, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 22605    
Bug Blocks:    
Attachments: Bug 31271: Preselect previous search index
Bug 31271: Preselect previous search index
Bug 31271: Preselect previous search index

Description Katrin Fischer 2022-07-30 15:24:09 UTC
To test:
- Go to the advanced search in the staff interface
- Select Barcode as search option and search for a non-existing barcode
- From the search results, go back by Edit search link
- Verify the search option flipped back to Keyword :(
Comment 1 Jonathan Druart 2022-08-01 14:48:50 UTC
Is it a regression?
Comment 2 Jonathan Druart 2022-08-01 14:50:40 UTC
(In reply to Jonathan Druart from comment #1)
> Is it a regression?

Hum, guess no.
Comment 3 Donna 2022-10-25 16:10:50 UTC
I would argue it is a regression - in previous versions, when I click back to the advanced search to edit the search, the search options are retained.  The edit search button should do the same thing.  I can click the back arrow and the fields are retained, so having the behavior differ between using the "proper" edit link vs back arrow is rather frustrating.
Comment 4 Katrin Fischer 2022-10-25 21:04:30 UTC
I also felt like I had tested this when the edit link was added... Adding Nick.
Comment 5 Nick Clemens 2022-11-03 12:32:15 UTC
Created attachment 143086 [details] [review]
Bug 31271: Preselect previous search index

This patch passes the constructed value of the preselect to search_indexes.inc

To test:
1 - Perform an advanced search, making sure to select different indexes
2 - Click 'Edit search' on results page
3 - Confirm index selections are preselected
4 - Enable  IntranetCatalogSearchPulldown
5 - Do a search form the top bar using an index
6 - Confirm 'Edit search' correctly popluates the chosen index
Comment 6 Andrew Fuerste-Henry 2022-11-03 16:50:13 UTC
Created attachment 143139 [details] [review]
Bug 31271: Preselect previous search index

This patch passes the constructed value of the preselect to search_indexes.inc

To test:
1 - Perform an advanced search, making sure to select different indexes
2 - Click 'Edit search' on results page
3 - Confirm index selections are preselected
4 - Enable  IntranetCatalogSearchPulldown
5 - Do a search form the top bar using an index
6 - Confirm 'Edit search' correctly popluates the chosen index

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 7 Katrin Fischer 2022-11-09 12:24:01 UTC
Created attachment 143496 [details] [review]
Bug 31271: Preselect previous search index

This patch passes the constructed value of the preselect to search_indexes.inc

To test:
1 - Perform an advanced search, making sure to select different indexes
2 - Click 'Edit search' on results page
3 - Confirm index selections are preselected
4 - Enable  IntranetCatalogSearchPulldown
5 - Do a search form the top bar using an index
6 - Confirm 'Edit search' correctly popluates the chosen index

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi 2022-11-09 13:06:39 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!