Bug 24443 - Consider NULL as 0 for issues in items search
Summary: Consider NULL as 0 for issues in items search
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-17 09:24 UTC by Fridolin Somers
Modified: 2021-12-13 21:08 UTC (History)
6 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.03, 19.05.08
Circulation function:


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 (ashimema) 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 (lukeg) 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.