Bug 10976

Summary: the assistant for reports uses the wrong value for the list of item types
Product: Koha Reporter: Gaetan Boisson <gaetan.boisson>
Component: ReportsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, jonathan.druart, nengard, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 10976: Fix typo itemtype vs itemtypes
[Signed-off] Bug 10976: Fix typo itemtype vs itemtypes
[PASSED QA] Bug 10976: Fix typo itemtype vs itemtypes

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 (tcohen) 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. ***