Bug 10976 - the assistant for reports uses the wrong value for the list of item types
Summary: the assistant for reports uses the wrong value for the list of item types
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 13091 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-30 13:16 UTC by Gaetan Boisson
Modified: 2016-09-14 10:20 UTC (History)
5 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:


Attachments
Bug 10976: Fix typo itemtype vs itemtypes (1.68 KB, patch)
2015-04-22 11:28 UTC, Jonathan Druart
Details | Diff | Splinter Review
[Signed-off] Bug 10976: Fix typo itemtype vs itemtypes (1.90 KB, patch)
2015-04-29 11:23 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 10976: Fix typo itemtype vs itemtypes (1.95 KB, patch)
2015-05-03 17:29 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Gaetan Boisson 2013-09-30 13:16:19 UTC
When using the assistant to create a new report (guided_reports.pl), if you choose to limit according to the itemtype, the generated code is <<itype|itemtype>>, but the proper value for the report to work should be <<itype|itemtypes>> (with an extra 's').

(This was also wrong in the wiki. Fixed now.)
Comment 1 Jonathan Druart 2015-04-22 11:28:18 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-04-23 09:47:37 UTC
I can not trigger the error after test plan #2 (without patch).
Comment 3 Jonathan Druart 2015-04-29 09:23:09 UTC
(In reply to Marc Véron from comment #2)
> I can not trigger the error after test plan #2 (without patch).

Marc, Have you gone to the last step "Save your custom report"?
Give a name to the report and click "save report".
Comment 4 Marc Véron 2015-04-29 10:03:11 UTC
Testing (without patch)

Home > Reports > Guided reports wizard  
Button [Bulid new]
Step 1: Choose Circulaton , Not public
Step 2: Report type Tabular
Step 3: Choose some columns from Biblioitems and add them
Step 4: Check "Koha itemtype" (BK), Check Type (issue)
Step 5: Check items.itemnumber and set to 'count'
Step 6: Check items.itemnumber (asc)
Finish
Save as... Testreport-Bug10976 Report OK (see comment #3)
Run this report -> Get table on screen
Download as Comma separated text -> Download OK

What do I miss? :-)
Comment 5 Jonathan Druart 2015-04-29 10:20:31 UTC
(In reply to Marc Véron from comment #4)
> Testing (without patch)
> 
> Home > Reports > Guided reports wizard  
> Button [Bulid new]
> Step 1: Choose Circulaton , Not public
> Step 2: Report type Tabular
> Step 3: Choose some columns from Biblioitems and add them
> Step 4: Check "Koha itemtype" (BK), Check Type (issue)

Here check 'Koha itemtype' but don't choose a value.
Comment 6 Marc Véron 2015-04-29 11:18:49 UTC
Ok, reproduced:

Errors found when processing parameters for report:
itype: The authorized value category (itemtype) you selected does not exist.
Comment 7 Marc Véron 2015-04-29 11:23:53 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2015-05-03 17:29:14 UTC
Created attachment 38786 [details] [review]
[PASSED QA] Bug 10976: Fix typo itemtype vs itemtypes

When creating a new report, the limit step let you choose
itype|itemtype.
But it should be itype|itemtypes.
If you try to create a guided report and you choose this option as a
limit, you will get a warning on saving it:
  Errors found when processing parameters for report:
  itype: The authorized value category (itemtype) you selected does not exist.

Looking at the code: reports/guided_reports.pl l.657
  elsif ( $authorised_value eq "itemtypes" ) {

Test plan:
0/ Don't apply the patch
1/ Create a guided report, select Koha itemtype as a limit(step 4)
2/ Confirm you get the error when saving
3/ Apply the patch and repeat step 1
4/ There is no error and the report should work correctly

Tested with steps in comment #4/#5, error is gone after applying patch.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Tomás Cohen Arazi 2015-05-06 17:34:57 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 10 Chris Cormack 2015-05-17 06:36:43 UTC
Pushed to 3.18.x will be in 3.18.7
Comment 11 Andreas Roussos 2016-09-14 10:20:03 UTC
*** Bug 13091 has been marked as a duplicate of this bug. ***