Bug 18393 - Statistics wizard for acquisitions not filtering correctly by collection code
Summary: Statistics wizard for acquisitions not filtering correctly by collection code
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-05 21:37 UTC by Barton Chittenden
Modified: 2019-05-27 12:25 UTC (History)
5 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:


Attachments
report settings (59.65 KB, image/png)
2017-04-05 21:37 UTC, Barton Chittenden
Details
Report results, all collection codes (58.07 KB, image/png)
2017-04-05 21:38 UTC, Barton Chittenden
Details
Report results, choose collection code 'music only' (58.26 KB, image/png)
2017-04-05 21:39 UTC, Barton Chittenden
Details
Bug 18939: Acquisition statistics - Fix wrong template variable name for collection filter (1.82 KB, patch)
2019-02-10 19:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18939: Acquisition statistics - Fix wrong template variable name for collection filter (1.88 KB, patch)
2019-02-12 15:05 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2017-04-05 21:37:20 UTC
Created attachment 61929 [details]
report settings

The canned report under Home › Reports › Acquisitions statistics is not filtering on collection code.

To replicate:

'Received on'
    check 'row'
    Filter: From: 01/01/2016 To: 12/31/2016
    (or use a date range that corresponds to acquisitions on your system)

'Collection code'
    check 'column'
    Filter: Select 'All'

Cell value
    Choose 'Count items'

Output
    Choose 'To screen into the browser'

Click Submit.

You will see columns of collection codes, with each row being a separate date. All collection codes will be displayed.

Use the browser's back button, change the collection code

'Collection code'
    check 'column'
    Filter: Select 'Music'
    (or a collection code on your system)

Click submit.

We would expect to see a single column showing the 'Music' collection code -- instead we see all collection codes again.

See screenshots for report settings and output.
Comment 1 Barton Chittenden 2017-04-05 21:38:22 UTC
Created attachment 61930 [details]
Report results, all collection codes
Comment 2 Barton Chittenden 2017-04-05 21:39:17 UTC
Created attachment 61931 [details]
Report results, choose collection code 'music only'
Comment 3 Katrin Fischer 2019-02-10 19:44:01 UTC
It looks like a template issue, the codes in the values are missing:

<select name="Filter">
<option value="" selected="selected">All</option>                       
<option value="">Fiction</option>
<option value="">Non-fiction</option>
<option value="">Reference</option>
Comment 4 Katrin Fischer 2019-02-10 19:57:27 UTC
Created attachment 84948 [details] [review]
Bug 18939: Acquisition statistics - Fix wrong template variable name for collection filter

The template variable was wrong, so the filter never submitted the
collection code for the query.

Before:
<option value="">Fiction</option>
<option value="">Non-fiction</option>

After:
<option value="FIC">Fiction</option>
<option value="NFIC">Non-fiction</option>

To test:
- Go to Reports > Statistics wizards > Acquisitions
- Pick a row and column
- Compare results with and without collection filter
- Verify the table is always the same
- Apply patch
- Repeat comparison, verify the filter works now
Comment 5 Martin Renvoize 2019-02-12 15:05:48 UTC
Created attachment 85023 [details] [review]
Bug 18939: Acquisition statistics - Fix wrong template variable name for collection filter

The template variable was wrong, so the filter never submitted the
collection code for the query.

Before:
<option value="">Fiction</option>
<option value="">Non-fiction</option>

After:
<option value="FIC">Fiction</option>
<option value="NFIC">Non-fiction</option>

To test:
- Go to Reports > Statistics wizards > Acquisitions
- Pick a row and column
- Compare results with and without collection filter
- Verify the table is always the same
- Apply patch
- Repeat comparison, verify the filter works now

https://bugs.koha-community.org/show_bug.cgi?id=18393
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2019-02-12 15:06:22 UTC
Nice work Katrin, another great fix that I'm going to go straight for PQA on.. works well, no regressions found.
Comment 7 Nick Clemens 2019-02-15 18:47:45 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-02-25 13:52:25 UTC
Pushed to 18.11.x for 18.11.04 - I corrected the commit message to state the correct bug number on push too.. 18939 -> 18393
Comment 9 Lucas Gass 2019-03-05 21:13:51 UTC
backported to 18.05.x for 18.05.11