Bug 24443

Summary: Consider NULL as 0 for issues in items search
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: SearchingAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, arthur.suzuki, hayleypelham, jonathan.druart, lucas, maryse.simard
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23081
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26032
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.03, 19.05.08
Attachments: Bug 24443: Consider NULL as 0 for issues in items search
Bug 24443: Unit test
Bug 24443: Consider NULL as 0 for issues in items search
Bug 24443: Unit test
Bug 24443: Unit test
Bug 24443: Unit test
Bug 24443: Unit test
Bug 24443: Unit test
Bug 24443: Unit test
Bug 24443: Consider NULL as 0 for issues in items search
Bug 24443: Unit test
Bug 24443: Consider NULL as 0 for issues in items search
Bug 24443: Unit test

Description Fridolin Somers 2020-01-17 09:24:38 UTC
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.
Comment 1 Fridolin Somers 2020-01-17 09:31:00 UTC
Created attachment 97480 [details] [review]
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
Comment 2 Fridolin Somers 2020-01-17 09:49:12 UTC
Created attachment 97481 [details] [review]
Bug 24443: Unit test
Comment 3 Fridolin Somers 2020-01-17 09:56:14 UTC
Created attachment 97482 [details] [review]
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
Comment 4 Fridolin Somers 2020-01-17 09:56:24 UTC
Created attachment 97483 [details] [review]
Bug 24443: Unit test
Comment 5 Fridolin Somers 2020-01-17 10:07:54 UTC
Created attachment 97486 [details] [review]
Bug 24443: Unit test
Comment 6 Fridolin Somers 2020-01-17 10:10:06 UTC
Created attachment 97487 [details] [review]
Bug 24443: Unit test
Comment 7 Fridolin Somers 2020-01-17 10:13:24 UTC
Created attachment 97488 [details] [review]
Bug 24443: Unit test
Comment 8 Fridolin Somers 2020-01-17 10:46:42 UTC
Created attachment 97493 [details] [review]
Bug 24443: Unit test
Comment 9 Fridolin Somers 2020-01-17 10:57:21 UTC
Created attachment 97496 [details] [review]
Bug 24443: Unit test
Comment 10 Maryse Simard 2020-01-17 19:53:34 UTC
Created attachment 97559 [details] [review]
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>
Comment 11 Maryse Simard 2020-01-17 19:53:37 UTC
Created attachment 97560 [details] [review]
Bug 24443: Unit test

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 12 Jonathan Druart 2020-01-23 11:36:20 UTC
Created attachment 97801 [details] [review]
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>
Comment 13 Jonathan Druart 2020-01-23 11:36:24 UTC
Created attachment 97802 [details] [review]
Bug 24443: Unit test

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Martin Renvoize 2020-01-24 15:21:20 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-02-10 22:01:37 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 16 Lucas Gass 2020-02-14 17:37:28 UTC
backported to 19.05.x for 19.05.08
Comment 17 Hayley Pelham 2020-02-17 01:24:04 UTC
Enhancement will not be backported to 18.11.x series.