Bug 25791 - SCO print dialog pops up twice
Summary: SCO print dialog pops up twice
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on: 21565
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-17 22:10 UTC by Lucas Gass
Modified: 2021-12-13 21:08 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04, 19.11.10


Attachments
Bug 25791: Remove win.print() (1.61 KB, patch)
2020-07-15 22:32 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 25791: Remove win.print() (1.67 KB, patch)
2020-08-05 19:50 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 25791: Remove win.print() (1.73 KB, patch)
2020-08-23 01:00 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2020-06-17 22:10:11 UTC
With bz25597 the SCO print dialog now pops up twice (two separate dialog boxes) when a user clicks "Print receipt and end session".

To recreate:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
Comment 1 David Cook 2020-06-18 02:33:53 UTC
What browser are you using and on which OS? 

I don't think that I've experienced this, but happy to re-test.
Comment 2 Lucas Gass 2020-07-15 22:21:05 UTC
Hey David,

This only happens to me in FF. Chrome seems to work just fine.
Comment 3 Lucas Gass 2020-07-15 22:27:05 UTC
I believe this is because of some duplication of code in sco-main.tt:

var win = window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&print=qslip");
win.print();


If we use window.open, which opens a print dialog then we do not need to also have win.print()
Comment 4 Lucas Gass 2020-07-15 22:32:07 UTC
Created attachment 106941 [details] [review]
Bug 25791: Remove win.print()

Test plan:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
6) Apply patch
7) Repeat steps 1 - 4
8) Should only get a single print dialog.
9) Test in FF/Chrome and make sure behavior is consistent
Comment 5 David Cook 2020-07-16 03:43:26 UTC
I've made a note to check this out later.
Comment 6 ByWater Sandboxes 2020-08-05 19:50:16 UTC
Created attachment 107860 [details] [review]
Bug 25791: Remove win.print()

Test plan:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
6) Apply patch
7) Repeat steps 1 - 4
8) Should only get a single print dialog.
9) Test in FF/Chrome and make sure behavior is consistent

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 7 Katrin Fischer 2020-08-23 01:00:50 UTC
Created attachment 108947 [details] [review]
Bug 25791: Remove win.print()

Test plan:
1) Turn on system preference SelfCheckReceiptPrompt
2) Check out item via /cgi-bin/koha/sco/sco-main.pl
3) Click "Finish"
4) Click 'Print receipt and end session'
5) Notice two print dialog boxes right on top of each other
6) Apply patch
7) Repeat steps 1 - 4
8) Should only get a single print dialog.
9) Test in FF/Chrome and make sure behavior is consistent

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Jonathan Druart 2020-08-24 10:33:14 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Lucas Gass 2020-09-04 18:09:12 UTC
backported to 20.05.x for 20.05.04
Comment 10 Aleisha Amohia 2020-09-10 04:10:11 UTC
backported to 19.11.x for 19.11.10
Comment 11 Victor Grousset/tuxayo 2020-09-20 18:19:05 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.