Bug 15061

Summary: Can't add item to rotating collection
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: ToolsAssignee: Bernardo Gonzalez Kriegel <bgkriegel>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: bgkriegel, f.demians, jonathan.druart, katrin.fischer, liz, 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:
Attachments: rotating collection issue
Steps to reproduce error message (without plack)
Bug 15061: Can't add item to rotating collection
Bug 15061: Can't add item to rotating collection
[PASSED QA] Bug 15061: Can't add item to rotating collection

Description Josef Moravec 2015-10-26 11:43:34 UTC
Everytime you enter barcode to add it to rotating collection, you get an error message: "Failed to add item with barcode xxx: NO_ID"

Also, in empty collection you see table with items, but only with one empty row...
Comment 1 Jonathan Druart 2015-10-27 08:57:25 UTC
Josef,
It looks good here: http://test-intra.plack.bywatersolutions.com/cgi-bin/koha/rotating_collections/addItems.pl
Could you please detail your issue?
Comment 2 Josef Moravec 2015-10-27 09:03:08 UTC
Created attachment 44044 [details]
rotating collection issue

I'm adding a screenshot of the problem I'm facing
Comment 3 Josef Moravec 2015-10-27 09:05:36 UTC
I understand now, when I created a new collection, I tried to add items and somehow was redirected on page addItems without colId parameter... so of course adding items failed...
Comment 4 Jonathan Druart 2015-10-27 09:15:33 UTC
Please provide a step by step plan to reproduce, I don't get it.
Comment 5 Josef Moravec 2015-10-27 11:12:07 UTC
I can't reproduce it now as well... the problem was, I think, that collection ID was lost... but only one way I can reproduce it now is to manually go to address /cgi-bin/koha/rotating_collections/addItems.pl without any parameter... but it's not the way used by normal work....
Comment 6 Marc Véron 2015-11-02 07:55:37 UTC
Created attachment 44287 [details]
Steps to reproduce error message (without plack)

I can reproduce the issue in two steps (without plack):

1) Call /cgi-bin/koha/rotating_collections/addItems.pl without param
   Result: 
       Screen to add items. 
       Warning in intranet-error.log: Use of unitialized value in string eq
       at (...)adItems.pl line 42

   Expected result: Should display an error message

2) Try to add an item
   Result: 
       Displays error message:
       Failed to add item with barcode XXXX:
       NO_ID

See screenshots attached.
 

See screenshot.
Comment 7 Bernardo Gonzalez Kriegel 2015-11-03 15:24:21 UTC Comment hidden (obsolete)
Comment 8 Marc Véron 2015-11-03 15:50:20 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-11-03 23:46:57 UTC
Created attachment 44348 [details] [review]
[PASSED QA] Bug 15061: Can't add item to rotating collection

This patch prevents adding items to invalid (empty)
rotating collection id

To test:
1) Go to /cgi-bin/koha/rotating_collections/addItems.pl
2) Try to add an item, you get error show in attached pictures
3) Apply the patch
4) Go again to /cgi-bin/koha/rotating_collections/addItems.pl
5) Can't add any items

I don't know if this is a real problem

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Tomás Cohen Arazi 2015-11-04 14:02:08 UTC
Patch pushed to master.

Thanks Bernardo!
Comment 11 Frédéric Demians 2015-11-29 20:07:13 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.
Comment 12 Liz Rea 2016-01-06 21:06:29 UTC
Pushed to 3.18.13, and released.