Bug 20765 - Search for items by acqdate does not work in label batch
Summary: Search for items by acqdate does not work in label batch
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin SOMERS
QA Contact: Tomás Cohen Arazi
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 14:17 UTC by Fridolin SOMERS
Modified: 2018-10-04 13:19 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 20765: Fix search for items by acqdate in label batch (1.96 KB, patch)
2018-05-14 14:33 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 20765: Fix search for items by acqdate in label batch (2.05 KB, patch)
2018-06-29 18:30 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 20765: Fix search for items by acqdate in label batch (2.74 KB, patch)
2018-09-15 22:29 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2018-05-14 14:17:10 UTC
In Tools >  Label creator, when creating a batch you can add items using a search.

This search has filters on acquisition date.
Actually those filters does not work.
The create a search using CCL syntaxe to query Zebra search engine.
Comment 1 Fridolin SOMERS 2018-05-14 14:33:28 UTC
Created attachment 75306 [details] [review]
Bug 20765: Fix search for items by acqdate in label batch

In Tools >  Label creator, when creating a batch you can add items using a search.

This search has filters on acquisition date.
Actually those filters does not work.
The create a search using CCL syntaxe to query Zebra search engine.

The cause is that operator "ge" or "le" must be before "st-date-normalized" in CCL query.
Looks like it is because of "st-date-normalized" uses "r=o" in ccl.properties.

Test plan :
1) Check in advance search you have indexed acquisition date
2) Go to Tools > Label creator
3) Click on New > Label batch
4) Click on Add item(s)
5) Enter a relevent date in "Added on or after date" and in "Added on or before date"
6) Click on "Search"
=> Without patch you get no results
=> With patch you get expected results
Comment 2 Maryse Simard 2018-06-29 18:30:15 UTC
Created attachment 76581 [details] [review]
Bug 20765: Fix search for items by acqdate in label batch

In Tools >  Label creator, when creating a batch you can add items using a search.

This search has filters on acquisition date.
Actually those filters does not work.
The create a search using CCL syntaxe to query Zebra search engine.

The cause is that operator "ge" or "le" must be before "st-date-normalized" in CCL query.
Looks like it is because of "st-date-normalized" uses "r=o" in ccl.properties.

Test plan :
1) Check in advance search you have indexed acquisition date
2) Go to Tools > Label creator
3) Click on New > Label batch
4) Click on Add item(s)
5) Enter a relevent date in "Added on or after date" and in "Added on or before date"
6) Click on "Search"
=> Without patch you get no results
=> With patch you get expected results

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Comment 3 Katrin Fischer 2018-07-01 20:47:41 UTC
Hi Frido, I get the same number of results with and without this patch on my kohadevbox. I am using the MARC21 sample data, searching with: 01/01/2016 to 01/01/2017 - 2 results.
Comment 4 Fridolin SOMERS 2018-07-30 14:42:12 UTC
(In reply to Katrin Fischer from comment #3)
> Hi Frido, I get the same number of results with and without this patch on my
> kohadevbox. I am using the MARC21 sample data, searching with: 01/01/2016 to
> 01/01/2017 - 2 results.

Ah we use Zebra 2.1.3 from IndexData repository http://ftp.indexdata.dk/ubuntu/
Could you check with this version please ?
Comment 5 Katrin Fischer 2018-08-01 22:15:23 UTC
Hi Frido, using kohadevbox for testing:

Zebra version: 	Zebra 2.0.59 (C) 1994-2014, Index Data Zebra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. SHA1 ID: c00bfddbf0f3608340d61298acc61dafb167f9b2 Using ICU
Comment 6 Fridolin SOMERS 2018-09-05 13:28:06 UTC
(In reply to Katrin Fischer from comment #5)
> Hi Frido, using kohadevbox for testing:
> 
> Zebra version: 	Zebra 2.0.59 (C) 1994-2014, Index Data Zebra is free
> software, covered by the GNU General Public License, and you are welcome to
> change it and/or distribute copies of it under certain conditions. SHA1 ID:
> c00bfddbf0f3608340d61298acc61dafb167f9b2 Using ICU

Ah oki.
Can you test with upgrading zebra software ?
See http://ftp.indexdata.com/pub/debian/README

And if it does not brakes anything with Zebra 2.0.59, can i still be pushed ?
Comment 7 Tomás Cohen Arazi 2018-09-15 22:29:40 UTC
Created attachment 78906 [details] [review]
Bug 20765: Fix search for items by acqdate in label batch

In Tools >  Label creator, when creating a batch you can add items using a search.

This search has filters on acquisition date.
Actually those filters does not work.
The create a search using CCL syntaxe to query Zebra search engine.

The cause is that operator "ge" or "le" must be before "st-date-normalized" in CCL query.
Looks like it is because of "st-date-normalized" uses "r=o" in ccl.properties.

Test plan :
1) Check in advance search you have indexed acquisition date
2) Go to Tools > Label creator
3) Click on New > Label batch
4) Click on Add item(s)
5) Enter a relevent date in "Added on or after date" and in "Added on or before date"
6) Click on "Search"
=> SUCCESS: You get results
7) Apply the patch
8) Retry the 'Add item(s)' step
=> SUCCESS: Patch doesn't change behaviour for old Zebra
9) Get rid of the patch on your working branch
10) Use the latest Zebra:
- /etc/apt/sources.list.d/indexdata.list:
deb http://ftp.indexdata.dk/debian jessie main
- Add the repo key:
  $ wget http://ftp.indexdata.dk/debian/indexdata.asc -O- | sudo apt-key add -
- Upgrade:
  $ sudo apt update; sudo apt dist-upgrade
  $ sudo koha-rebuild-zebra -f -a -b -v kohadev
  $ restart_all
11) Retry the 'Add item(s)' step
=> FAIL: No results!
9) Apply the patch, retry
=> SUCCESS: Search results!
- Sign off :-D

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and it works.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
It doesn't break with 2.0.59-1 (stretch/jessie), and fixes the problem
for 2.1.X.
Comment 8 Nick Clemens 2018-09-15 23:30:07 UTC
Awesome work all!

Pushed to master for 18.11
Comment 9 Martin Renvoize 2018-09-17 13:55:10 UTC
Pushed to 18.05.x for 18.05.04
Comment 10 Fridolin SOMERS 2018-09-24 09:53:15 UTC
Pushed to 17.11.x for 17.11.10