Bugzilla – Attachment 97801 Details for
Bug 24443
Consider NULL as 0 for issues in items search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24443: Consider NULL as 0 for issues in items search
Bug-24443-Consider-NULL-as-0-for-issues-in-items-s.patch (text/plain), 1.40 KB, created by
Jonathan Druart
on 2020-01-23 11:36:20 UTC
(
hide
)
Description:
Bug 24443: Consider NULL as 0 for issues in items search
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-23 11:36:20 UTC
Size:
1.40 KB
patch
obsolete
>From 2d511de98c7d4578f0933f1fc650767f687ee529 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 17 Jan 2020 10:25:19 +0100 >Subject: [PATCH] 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> >--- > C4/Items.pm | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 1b41846d82..498c3eb43c 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2142,6 +2142,9 @@ sub _SearchItems_build_where_fragment { > } > $column = "ExtractValue($sqlfield, '$xpath')"; > } >+ } elsif ($field eq 'issues') { >+ # Consider NULL as 0 for issues count >+ $column = 'COALESCE(issues,0)'; > } else { > $column = $field; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24443
:
97480
|
97481
|
97482
|
97483
|
97486
|
97487
|
97488
|
97493
|
97496
|
97559
|
97560
| 97801 |
97802