[Bug 16575] New: Irregular behaviour using window.print() followed by window.location.href=
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Bug ID: 16575 Summary: Irregular behaviour using window.print() followed by window.location.href= Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org As we noticed in bug 11014, different browsers handle "window.print()" differently. In the case of window.print() followed by window.location.href=, I've found in IE 11 on Windows 8.1 that the browser changes the window location before the system print dialogue even opens. If I try to mitigate that using the timer from bug 11014, it works in IE and Chrome, but it breaks in Firefox. If I try to use the onafterprint in IE and Firefox, it works in IE but it breaks in Firefox. I started wondering if we even need to be using this window.print() followed by window.location.href= and it occurred to me that we really don't. We should just be using print.css. Patch to follow soon... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|oleonard@myacpl.org |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 51907 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51907&action=edit Bug 16575 - Irregular behaviour using window.print() followed by window.location.href= Use print.css for OPAC basket when printing instead of using navigation. Currently, when you click "Print" on the OPAC basket, it'll navigate to a new page and initiate window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print.css, we don't navigate away from the basket in the first place, so we prevent this irregular behaviour. _TEST PLAN_ 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- At some point, it would be prudent to strip the now unnecessary "print_basket" stuff out of opac-basket.tt. I didn't include it here, as it wasn't necessary for the actual bug fix. I also didn't want to do the work of removing all that code, if QA decides that this fix is no good, so I'm happy to add a follow-up once QA is happy with this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #51907|0 |1 is obsolete| | --- Comment #3 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 51908 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=51908&action=edit [SIGNED-OFF] Bug 16575 - Irregular behaviour using window.print() followed by window.location.href= Use print.css for OPAC basket when printing instead of using navigation. Currently, when you click "Print" on the OPAC basket, it'll navigate to a new page and initiate window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print.css, we don't navigate away from the basket in the first place, so we prevent this irregular behaviour. _TEST PLAN_ 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |srdjan@catalyst.net.nz --- Comment #4 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- I think you should have included js removal with the patch, not used so should go. What's the story with the intranet basket? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Srdjan Jankovic from comment #4)
I think you should have included js removal with the patch, not used so should go. What's the story with the intranet basket?
Good points. It looks like the intranet has the same issue as the OPAC basket, so I should change that... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Same as Srdjan :) So please: 1/ apply the same fix for intranet 2/ remove the JS function 3/ remove the code related to the print param Additional comments: 4/ With your patch, the first column is now printed (checkbox) 5/ I only see 8 (out of 20) records printed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Thanks for looking at this Jonathan :). I don't have time to work on this right now, but I'll keep it in mind for the future. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Can't believe it's almost been 6 months. This is still on my to do list although I don't think I'll be looking at it until 2017 at the earliest. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #51908|0 |1 is obsolete| | --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 75664 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75664&action=edit Bug 16575: Irregular behaviour using window.print() followed by window.location.href This patch updates the OPAC and staff client carts to use CSS to control print output, removing a print parameter which was passed to the script. Currently, when you click "Print" on the OPAC basket, it navigates to a new page and initiates window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print CSS, we don't navigate away from the basket in the first place, so we prevent this irregular behavior. TEST PLAN 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up 6) Perform the same tests in the staff client -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #10 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 75665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=75665&action=edit Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|dcook@prosentient.com.au |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75664|0 |1 is obsolete| | --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 76768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76768&action=edit Bug 16575: Irregular behaviour using window.print() followed by window.location.href This patch updates the OPAC and staff client carts to use CSS to control print output, removing a print parameter which was passed to the script. Currently, when you click "Print" on the OPAC basket, it navigates to a new page and initiates window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print CSS, we don't navigate away from the basket in the first place, so we prevent this irregular behavior. TEST PLAN 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up 6) Perform the same tests in the staff client Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #75665|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 76769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76769&action=edit Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Needs Signoff |Signed Off --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I redid the second patch from scratch as it did no longer apply. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> ---
5) After printing is complete, you should still be on the OPAC basket pop-up
The popup is still open, but I did not return to it. (Chrome, FF) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #13)
I redid the second patch from scratch as it did no longer apply.
You made a mistake: Patch 2 was: From: Owen Leonard <oleonard@myacpl.org> Date: Wed, 30 May 2018 14:18:43 +0000 Subject: [PATCH] Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. --- koha-tmpl/opac-tmpl/bootstrap/css/print.css | 2 +- But it became (you changed ANOTHER file): From: Katrin Fischer <katrin.fischer.83@web.de> Date: Sun, 8 Jul 2018 01:21:23 +0000 Subject: [PATCH 2/2] Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. --- koha-tmpl/opac-tmpl/bootstrap/css/opac.css | 2 +- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, what I did was skipping the second original patch as it didn't apply and running the opac-less command - strange that I came out with a changed file anyway. I would have expected an empty file. And also a bit strange that the print file was not regenerated, have to investigate. Thx for noticing! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- not an empty file, but no changed in the one I actually committed... sorry for being unclear. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76769|0 |1 is obsolete| | --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 76967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76967&action=edit Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I fixed the CSS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76768|0 |1 is obsolete| | --- Comment #20 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76971 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76971&action=edit Bug 16575: Irregular behaviour using window.print() followed by window.location.href This patch updates the OPAC and staff client carts to use CSS to control print output, removing a print parameter which was passed to the script. Currently, when you click "Print" on the OPAC basket, it navigates to a new page and initiates window.print() followed by a window.location.href change again. Unfortunately, due to differences in IE, Chrome, and FF, it will either show the print options, navigate away without showing them, or refuse to navigate away after printing. By changing to using print CSS, we don't navigate away from the basket in the first place, so we prevent this irregular behavior. TEST PLAN 1) Apply the patch 2) Create an OPAC basket by clicking "Add to cart" on multiple items 3) Using Chrome, IE, and Firefox (of any version), click the "Print" button 4) You should see the relevant print menu without the OPAC basket re-loading in any way. 5) After printing is complete, you should still be on the OPAC basket pop-up 6) Perform the same tests in the staff client Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76967|0 |1 is obsolete| | --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 76972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76972&action=edit Bug 16575: (follow-up) Compiled CSS This patch contains the compiled CSS for the OPAC print stylesheet. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #19)
I fixed the CSS.
Thanks. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #23 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |Pushed to Stable --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16575 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org