Bug 16984

Summary: Standing orders - when ordering a JS error is raised
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: claire_gravely, jonathan.druart, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 15531    
Bug Blocks:    
Attachments: Bug 16984: Do not clone the item block for standing orders
Bug 16984: Do not clone the item block for standing orders
Bug 16984: Do not clone the item block for standing orders

Description Kyle M Hall (khall) 2016-07-26 17:17:29 UTC
In acquisitions, even if AcqCreateItem is set to create an item at the time of ordering, the item creation form does not display.

Instead, this JavaScript error shows in the console:
additem.js:176 Uncaught TypeError: window[events[i]] is not a function

I believe this regression was introduced by bug 15531.
Comment 1 Katrin Fischer 2016-07-26 17:28:08 UTC
Can't reproduce this on my installation - the item form shows ok for me.

- ACQ framework exists
- items are created while ordering
- order i tested with was with a new record and 'not standing'
Comment 2 Kyle M Hall (khall) 2016-07-26 17:39:33 UTC
Starting with a fresh database, I could not reproduce the issue!
Comment 3 Jonathan Druart 2016-11-15 13:44:22 UTC
Confirmed, if aqbasket.is_standing = 1, I get the same error.
Comment 4 Jonathan Druart 2016-11-22 09:27:10 UTC
This is the expected behavior for standing orders, we just need to get rid of the JS error.
Lowering the severity.
Comment 5 Jonathan Druart 2016-11-22 09:39:07 UTC
Created attachment 57695 [details] [review]
Bug 16984: Do not clone the item block for standing orders

If AcqCreateItem is set to ordering and the basket is marked as
"standing orders", when ordering a JS error is raised:
additem.js:176 Uncaught TypeError: window[events[i]] is not a function

The item block should not be displayed in that case.

Test plan:
- Set AcqCreateItem to "ordering"
- Create a basket and tick the "Standing orders" checkbox
- Add an order to this basket
=> Without this patch you get the JS error
=> With this patch applied you will not get it
Comment 6 Claire Gravely 2017-01-09 10:10:31 UTC
I have also been unable to reproduce the issue.
Comment 7 Claire Gravely 2017-01-09 17:31:50 UTC
(In reply to Claire Gravely from comment #6)
> I have also been unable to reproduce the issue.

have now reproduced - will retest
Comment 8 Claire Gravely 2017-01-09 17:34:08 UTC
Created attachment 58704 [details] [review]
Bug 16984: Do not clone the item block for standing orders

If AcqCreateItem is set to ordering and the basket is marked as
"standing orders", when ordering a JS error is raised:
additem.js:176 Uncaught TypeError: window[events[i]] is not a function

The item block should not be displayed in that case.

Test plan:
- Set AcqCreateItem to "ordering"
- Create a basket and tick the "Standing orders" checkbox
- Add an order to this basket
=> Without this patch you get the JS error
=> With this patch applied you will not get it

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 9 Nick Clemens (kidclamp) 2017-02-03 10:43:32 UTC
Created attachment 59867 [details] [review]
Bug 16984: Do not clone the item block for standing orders

If AcqCreateItem is set to ordering and the basket is marked as
"standing orders", when ordering a JS error is raised:
additem.js:176 Uncaught TypeError: window[events[i]] is not a function

The item block should not be displayed in that case.

Test plan:
- Set AcqCreateItem to "ordering"
- Create a basket and tick the "Standing orders" checkbox
- Add an order to this basket
=> Without this patch you get the JS error
=> With this patch applied you will not get it

Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Kyle M Hall (khall) 2017-02-14 13:55:00 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 11 Katrin Fischer 2017-02-14 19:35:27 UTC
This patch has been pushed to 16.11.x and will be in 16.11.04.
Comment 12 Mason James 2017-02-22 23:11:17 UTC
Pushed to 16.05.x, for 16.05.10 release