Bug 24443 - Consider NULL as 0 for issues in items search
Summary: Consider NULL as 0 for issues in items search
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-17 09:24 UTC by Fridolin SOMERS
Modified: 2020-02-17 01:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
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 (1.27 KB, patch)
2020-01-17 09:31 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.53 KB, patch)
2020-01-17 09:49 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Consider NULL as 0 for issues in items search (1.27 KB, patch)
2020-01-17 09:56 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.56 KB, patch)
2020-01-17 09:56 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.56 KB, patch)
2020-01-17 10:07 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.56 KB, patch)
2020-01-17 10:10 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.55 KB, patch)
2020-01-17 10:13 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.83 KB, patch)
2020-01-17 10:46 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Unit test (1.83 KB, patch)
2020-01-17 10:57 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 24443: Consider NULL as 0 for issues in items search (1.33 KB, patch)
2020-01-17 19:53 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 24443: Unit test (1.89 KB, patch)
2020-01-17 19:53 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 24443: Consider NULL as 0 for issues in items search (1.40 KB, patch)
2020-01-23 11:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24443: Unit test (1.96 KB, patch)
2020-01-23 11:36 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 Mapley 2020-02-17 01:24:04 UTC
Enhancement will not be backported to 18.11.x series.