Bug 23970 - itemsearch - publication date not taken into account if not used in the first field
Summary: itemsearch - publication date not taken into account if not used in the first...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 14636
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-05 09:33 UTC by Christian Stelzenmüller
Modified: 2021-06-14 21:28 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.01, 19.05.06, 18.11.13


Attachments
Bug 23970: Search by "publication date" only works if used in first field (1.66 KB, patch)
2019-11-25 12:38 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23970: Make search with "Publication date" field work at any position (1.66 KB, patch)
2019-12-04 11:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23970: Make search with "Publication date" field work at any position (1.81 KB, patch)
2019-12-04 12:15 UTC, Joonas Kylmälä
Details | Diff | Splinter Review
Bug 23970: Make search with "Publication date" field work at any position (1.91 KB, patch)
2019-12-06 09:50 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 Christian Stelzenmüller 2019-11-05 09:33:00 UTC
Itemsearch.
Search for: 
publication date: 2005 OR
publication date: 2006

Koha doesn't take the search for 2006 into account. Only items from 2005 are shown in the search results.
Comment 1 Jonathan Druart 2019-11-25 12:38:54 UTC
Created attachment 95787 [details] [review]
Bug 23970: Search by "publication date" only works if used in first field

The changes made in the following commit:
  commit 0d2e83bca5b91376e9262b6cb0b993f09b919018
  Bug 14636: Item search - fix search and sort by publication date for MARC21
was put at the wrong place. It was inside a "if $i == 1" test that
impacts the first field only.

Test plan:
0/ Use a MARC21 installation
1/ Search items by publication date, use twice the field using different
values.
For instance:
  publication date: 2005 OR
  publication date: 2006
=> Without this patch you only get results for 2005
=> With this patch applied you get results for both years.
Comment 2 Joonas Kylmälä 2019-12-04 11:07:47 UTC
Jonathan, please put in the patch title what the patch does instead of what the problem is (https://wiki.koha-community.org/wiki/Commit_messages#Examples). Maybe like "Bug 23970: Make search with "Publication date" field work at any position", and in the body explain the problem and the fix in more detail.

Btw, on top of that same wiki page the "Good commit" message has the same problem that it doesn't state what the commit does.
Comment 3 Jonathan Druart 2019-12-04 11:51:50 UTC
Created attachment 95990 [details] [review]
Bug 23970: Make search with "Publication date" field work at any position

The changes made in the following commit:
  commit 0d2e83bca5b91376e9262b6cb0b993f09b919018
  Bug 14636: Item search - fix search and sort by publication date for MARC21
was put at the wrong place. It was inside a "if $i == 1" test that
impacts the first field only.

Test plan:
0/ Use a MARC21 installation
1/ Search items by publication date, use twice the field using different
values.
For instance:
  publication date: 2005 OR
  publication date: 2006
=> Without this patch you only get results for 2005
=> With this patch applied you get results for both years.
Comment 4 Jonathan Druart 2019-12-04 11:52:10 UTC
(In reply to Joonas Kylmälä from comment #2)
> Jonathan, please put in the patch title what the patch does instead of what
> the problem is
> (https://wiki.koha-community.org/wiki/Commit_messages#Examples). Maybe like
> "Bug 23970: Make search with "Publication date" field work at any position",
> and in the body explain the problem and the fix in more detail.
> 
> Btw, on top of that same wiki page the "Good commit" message has the same
> problem that it doesn't state what the commit does.

I wrote that, thanks for catching me! :)
Comment 5 Joonas Kylmälä 2019-12-04 12:15:29 UTC
Created attachment 95991 [details] [review]
Bug 23970: Make search with "Publication date" field work at any position

The changes made in the following commit:
  commit 0d2e83bca5b91376e9262b6cb0b993f09b919018
  Bug 14636: Item search - fix search and sort by publication date for MARC21
was put at the wrong place. It was inside a "if $i == 1" test that
impacts the first field only.

Test plan:
0/ Use a MARC21 installation
1/ Search items by publication date, use twice the field using different
values.
For instance:
  publication date: 2005 OR
  publication date: 2006
=> Without this patch you only get results for 2005
=> With this patch applied you get results for both years.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Comment 6 Marcel de Rooy 2019-12-06 09:50:41 UTC
Created attachment 96061 [details] [review]
Bug 23970: Make search with "Publication date" field work at any position

The changes made in the following commit:
  commit 0d2e83bca5b91376e9262b6cb0b993f09b919018
  Bug 14636: Item search - fix search and sort by publication date for MARC21
was put at the wrong place. It was inside a "if $i == 1" test that
impacts the first field only.

Test plan:
0/ Use a MARC21 installation
1/ Search items by publication date, use twice the field using different
values.
For instance:
  publication date: 2005 OR
  publication date: 2006
=> Without this patch you only get results for 2005
=> With this patch applied you get results for both years.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Martin Renvoize 2019-12-10 16:18:19 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2019-12-19 21:47:38 UTC
Pushed to 19.11.01
Comment 9 Lucas Gass 2019-12-20 17:10:26 UTC
backported to 19.05.x for 19.05.06
Comment 10 Katrin Fischer 2020-01-10 12:21:54 UTC
Hi Hayley, not sure where you are in your review, but could you consider ths for 18.11 please? My coworker originally found it testing in 18.11 - so the bug is there :)
Comment 11 Hayley Pelham 2020-01-13 01:09:38 UTC
Backported to 18.11.x for 18.11.13