Bug 22595 - Items search is mixing inputs
Summary: Items search is mixing inputs
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 22596
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-27 14:07 UTC by Fridolin Somers
Modified: 2020-06-04 20:32 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 22595: Items search is mixing inputs (2.83 KB, patch)
2019-03-27 15:31 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 22595: Items search is mixing inputs (2.89 KB, patch)
2019-04-06 21:21 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 22595: Items search is mixing inputs (2.94 KB, patch)
2019-04-08 22:01 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2019-03-27 14:07:26 UTC
Items search is using inputs and selects from search form to create an Ajax call.

In this call selects are parsed before inputs.
But a custom search field can be used with authorised values and used after a regular search field.
In this case the "q" param is not ordered like the "name" param.
Comment 1 Fridolin Somers 2019-03-27 15:31:03 UTC
Created attachment 87076 [details] [review]
Bug 22595: Items search is mixing inputs

Items search is using inputs and selects from search form to create an Ajax call.

In this call selects are parsed before inputs.
But a custom search field can be used with authorised values and used after a regular search field.
In this case the "q" param is not ordered like the "name" param.

Test plan :
1) Go to Administration > Item search fields
2) Define a search field with an authorised values category
3) Go to items search
4) Use a regular filter like call number
5) Click on new field
6) Use custom field with an authorised value
7) Perform search
=> Without patch you get wrong resuts, authorised value is used as value for first field
=> You can see this by listening traffic in Firebug, look at params "f" and "q"
8) Check some combinaison of select and input filters
Comment 2 Michal Denar 2019-04-06 21:21:16 UTC
Created attachment 87480 [details] [review]
Bug 22595: Items search is mixing inputs

Items search is using inputs and selects from search form to create an Ajax call.

In this call selects are parsed before inputs.
But a custom search field can be used with authorised values and used after a regular search field.
In this case the "q" param is not ordered like the "name" param.

Test plan :
1) Go to Administration > Item search fields
2) Define a search field with an authorised values category
3) Go to items search
4) Use a regular filter like call number
5) Click on new field
6) Use custom field with an authorised value
7) Perform search
=> Without patch you get wrong resuts, authorised value is used as value for first field
=> You can see this by listening traffic in Firebug, look at params "f" and "q"
8) Check some combinaison of select and input filters

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 3 Katrin Fischer 2019-04-08 22:01:22 UTC
Created attachment 87562 [details] [review]
Bug 22595: Items search is mixing inputs

Items search is using inputs and selects from search form to create an Ajax call.

In this call selects are parsed before inputs.
But a custom search field can be used with authorised values and used after a regular search field.
In this case the "q" param is not ordered like the "name" param.

Test plan :
1) Go to Administration > Item search fields
2) Define a search field with an authorised values category
3) Go to items search
4) Use a regular filter like call number
5) Click on new field
6) Use custom field with an authorised value
7) Perform search
=> Without patch you get wrong resuts, authorised value is used as value for first field
=> You can see this by listening traffic in Firebug, look at params "f" and "q"
8) Check some combinaison of select and input filters

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Nick Clemens 2019-04-11 13:57:41 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize 2019-04-15 12:06:55 UTC
Pushed to 18.11.x for 18.11.05
Comment 6 Lucas Gass 2019-04-16 21:21:48 UTC
missing dependency for 18.05.x, wont backport