Bug 16984 - Standing orders - when ordering a JS error is raised
Summary: Standing orders - when ordering a JS error is raised
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 15531
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-26 17:17 UTC by Kyle M Hall
Modified: 2017-06-14 22:18 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 16984: Do not clone the item block for standing orders (1.39 KB, patch)
2016-11-22 09:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16984: Do not clone the item block for standing orders (1.45 KB, patch)
2017-01-09 17:34 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 16984: Do not clone the item block for standing orders (1.51 KB, patch)
2017-02-03 10:43 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 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 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 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 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