Bug 25940

Summary: Two separate print dialogs when checking in/transferring an item
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: CirculationAssignee: Lucas Gass (lukeg) <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: aleisha, gmcharlt, kyle.m.hall, lisettepalouse+koha, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.03, 19.11.09
Circulation function:
Bug Depends on:    
Bug Blocks: 26361    
Attachments: Bug 25940: Check for reserve_id before Dopop
Bug 25940: Check for reserve_id before Dopop
Bug 25940: Check for reserve_id before Dopop
Bug 25940: Check for reserve_id before Dopop

Description Lucas Gass (lukeg) 2020-07-06 20:29:12 UTC
When transferring an item returns.tt is generating multiple print dialogs. I can only recreate this is Chrome but I have heard reports that this is happening in FireFox as well.

TO RECREATE: (in Chrome)
1. Have an item belonging to a different branch and check it in. 
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.


I cannot recreate this in FireFox and I am unsure why not.
Comment 1 Lucas Gass (lukeg) 2020-07-06 20:43:47 UTC
Created attachment 106605 [details] [review]
Bug 25940: Check for reserve_id before Dopop

TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs
Comment 2 ByWater Sandboxes 2020-07-06 21:30:08 UTC
Created attachment 106611 [details] [review]
Bug 25940: Check for reserve_id before Dopop

TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Comment 3 Kyle M Hall (khall) 2020-07-10 10:20:56 UTC
Created attachment 106766 [details] [review]
Bug 25940: Check for reserve_id before Dopop

TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Katrin Fischer 2020-07-26 16:04:17 UTC
I have tried like what feels a thousand things, but I can't get the double print dialog to show :( 

But I see no harm in the code change, so I am going to pass this - it makes sense.
Comment 5 Katrin Fischer 2020-07-26 16:04:53 UTC
Created attachment 107374 [details] [review]
Bug 25940: Check for reserve_id before Dopop

TEST PLAN:
1. Have an item belonging to a different branch and check it in.
2. When the modal pops up hit 'Yes, print slip' or 'Print slip' if  AutomaticItemReturn is set to 'don't'
3. The first print dialog should appear with a URL like '/cgi-bin/koha/circ/transfer-slip.pl?transferitem=18&&branchcode=CPL&op=slip'
4. Close that print dialog and you will immediately see another one that says 'No slip template found'.
5. Notice the URL of the second pop-up is:  /cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=
6. There is no reserve id so the template is not found.
7. Apply patch
8. Repeat 1-6
9. You should no longer have two print dialogs

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2020-07-27 15:26:07 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 7 Lucas Gass (lukeg) 2020-07-31 21:01:58 UTC
backported to 20.05.x for 20.05.03
Comment 8 Aleisha Amohia 2020-08-03 23:48:52 UTC
backported to 19.11.x for 19.11.09
Comment 9 Victor Grousset/tuxayo 2020-09-18 20:27:48 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.