Bug 24443: Consider NULL as 0 for issues in items search
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 17 Jan 2020 09:25:19 +0000 (10:25 +0100)
committerJoy Nelson <joy@bywatersolutions.com>
Mon, 10 Feb 2020 21:52:15 +0000 (21:52 +0000)
commit2922249d92bad9a1df4ea95b48a7e28fdc68a315
tree26eafb181e637fb5fbaf1bee4b70ad3bb69983d2
parent541dfa7ddeec9fc72dd764165087dcfb601ddf07
Bug 24443: Consider NULL as 0 for issues in items search

In items search, we can filter by items issues count, data coming from items.issues.
Most of the time, for an item with no issues this column contains NULL.
This enhancement proposes to consider NULL as 0 to allow searching items with no issues.

Test plan:
1) Use SQL to count items with items.issues = NULL :
   select count(*) from items where issues is null;
2) Go to items search
3) Perform search with filter "Checkout count" = 0
4) Check you get the same number of results as SQL query

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
C4/Items.pm