Bug 24257

Summary: item-transfer-modal does not initiate transfer when 'yes, print slip' is selected
Product: Koha Reporter: Lucas Gass <lucas>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: 1joynelson, gmcharlt, jonathan.druart, kyle.m.hall, tomascohen
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:
20.05.00, 19.11.02
Bug Depends on: 21346    
Bug Blocks:    
Attachments: Bug 24257: Fix close of modal on 'Yes, print slip'
Bug 24257: Fix close of modal on 'Yes, print slip'
Bug 24257: Fix close of modal on 'Yes, print slip'

Description Lucas Gass 2019-12-17 15:50:30 UTC
When a item-transfer-modal is prompted by returns.tt and the option "Yes, print slip" is selected the transfer is not initiated and the modal does not disappear.

To recreate:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't belong to.
3. When the popup modal appears select 'Yes, print slip'.
4. Observe that the transfer does not initiate and the modal does not close.
5. In FF this also produces the following console error (this.form.print_slip is undefined)

Choosing 'Yes' works as excepted.
Comment 1 Jonathan Druart 2019-12-18 09:33:08 UTC
Maybe caused by bug 21346.
Comment 2 Jonathan Druart 2019-12-18 09:39:25 UTC
Created attachment 96406 [details] [review]
Bug 24257: Fix close of modal on 'Yes, print slip'

When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.

The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
  this.form.print_slip is undefined

Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes
Comment 3 Lucas Gass 2019-12-18 15:01:12 UTC
Created attachment 96422 [details] [review]
Bug 24257: Fix close of modal on 'Yes, print slip'

When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.

The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
  this.form.print_slip is undefined

Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass 2019-12-18 15:01:53 UTC
Thank you for the quick patch Jonathan!
Comment 5 Tomás Cohen Arazi 2020-01-08 15:43:37 UTC
Created attachment 97007 [details] [review]
Bug 24257: Fix close of modal on 'Yes, print slip'

When a item-transfer-modal is prompted by returns.tt and the option
"Yes, print slip" is selected the transfer is not initiated and the
modal does not disappear.

The print_slip hidden input must be in the same form as the
submit/button .print, otherwise the browser logs
  this.form.print_slip is undefined

Test plan:
1. set AutomaticItemReturn to "don't"
2. Check out an item and attempt to check it in at a branch it doesn't
belong to.
3. When the popup modal appears select 'Yes, print slip'.
=> Observe that the transfer does initiate and the modal closes

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Martin Renvoize 2020-01-09 16:34:10 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-01-12 19:14:48 UTC
Pushed to 19.11.x branch for 19.11.02