[Bug 43114] New: When printing hold/transfer slips on return.tt print window does not auto close in Firfox
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Bug ID: 43114 Summary: When printing hold/transfer slips on return.tt print window does not auto close in Firfox Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- 0. Use Firefox 1. Place a hold 2. Trigger the hold 3. Print the HOLD_SLIP 4. Notice the print window does not automatically close itself -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 David Kuhn <techservspec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |techservspec@gmail.com --- Comment #1 from David Kuhn <techservspec@gmail.com> --- The same also happens when printing a quick slip. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Sally Lodico <Slodico@knoxlib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Slodico@knoxlib.org --- Comment #2 from Sally Lodico <Slodico@knoxlib.org> --- We're seeing this too. What changed to cause this? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex@rcls.org --- Comment #3 from Alex Carver [Acerock7] <alex@rcls.org> --- +1. Seems to affect all slips. Can replicate with issue slips and summary slips as well. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Sam Young <sam.young@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|When printing hold/transfer |When printing hold/transfer |slips on return.tt print |slips on return.tt print |window does not auto close |window does not auto close |in Firfox |in Firefox CC| |sam.young@bywatersolutions. | |com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41705 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41705 [Bug 41705] Popup blockers may be triggered by options to automatically display payment receipt for printing after making a payments -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #4 from Christopher Brannon <cbrannon@cdalibrary.org> --- We're seeing this as well. I am noticing we are on 25.11.06 now, on both our test and production server. Didn't have this issue on .05. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #5 from Christopher Brannon <cbrannon@cdalibrary.org> --- My testing produced these results: This is the javascript the popup window generates: window.addEventListener('load', function() { window.print(); window.onafterprint = function () { window.close(); } }); Testing shows: afterprint fires correctly. window.close() works when run manually. Replacing the script with: window.onafterprint = function() { setTimeout(() => { window.close(); }, 100); }; window.print(); results in the window closing successfully. This appears to be a timing issue involving window.print() and registration/execution of the afterprint handler in Firefox. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #6 from Christopher Brannon <cbrannon@cdalibrary.org> --- Temporary workaround: In IntranetSlipPrinterJS window.addEventListener('load', function() { window.addEventListener('afterprint', function() { setTimeout(function() { window.close(); }, 100); }); window.print(); }); -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Rebecca Coert <rcoert@arlingtonva.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rcoert@arlingtonva.us -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #7 from Alex Carver [Acerock7] <alex@rcls.org> --- Christopher's JS tested and working on our site. Thank you! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Bug 43114 depends on bug 41705, which changed state. Bug 41705 Summary: Popup blockers may be triggered by options to automatically display payment receipt for printing after making a payments https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41705 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=43114 Samuel Sowanick <sam.sowanick@corvallisoregon.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sam.sowanick@corvallisorego | |n.gov --- Comment #8 from Samuel Sowanick <sam.sowanick@corvallisoregon.gov> --- +1. We too are having this issue. The work around is working for us too. Thank you Christopher. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Jonathan Field <jonathan.field@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.field@openfifth.co | |.uk --- Comment #9 from Jonathan Field <jonathan.field@openfifth.co.uk> --- We have also experienced this. We also mitigated it with Christopher's javascript fix in IntranetSlipPrinterJS. Between 25.11.04 and 25.11.06, bug 41705 removed a fallback line from koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc setTimeout('window.close()', 1000); //Hack from Chrome < 63 This fallback forced the print pop-up window closed one second after printing, regardless of whether the browser's afterprint event had fired. It was removed as part of 41705's clean-up, on the basis that it was an obsolete workaround for old Chrome versions. Unfortunately it still affects Firefox. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|When printing hold/transfer |When printing slips the |slips on return.tt print |print window does not auto |window does not auto close |close in Firefox |in Firefox | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Emily Lamancusa (emlam) <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #10 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212816 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212816&action=edit Bug 43114: Close the slip window after the print dialog Install the afterprint listener before calling print, since the event can fire before print returns. Defer closing briefly so Firefox can finish handling the dialog. Leave the automatically printed spine label open so the user can edit and reprint it. The IntranetSlipPrinterJS override continues to control printing when set. Thanks to Christopher and the reporters who tested the workaround in the Bugzilla discussion. Test plan: Before applying the patch: 1. Leave IntranetSlipPrinterJS empty. 2. In Firefox, open a patron's checkout page in the staff interface. 3. Choose Print > Print quick slip. 4. Complete the print dialog. The slip window stays open. 5. Repeat the print and dismiss the dialog with Cancel. Apply the patch. After applying the patch: 1. Repeat the quick slip flow in Firefox, once with Print and once with Cancel. The slip window closes after each dialog. 2. Repeat the quick slip flow in Chromium. 3. Enable SpineLabelAutoPrint. 4. Open Cataloging > Quick spine label creator. 5. Enter an item barcode and click View spine label. 6. Complete the automatic print. The label stays visible. 7. Click Edit this label and change the label text. 8. Click Print this label. The updated label can be printed. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #11 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212817 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212817&action=edit Bug 43114: Add Cypress coverage for automatic slip printing Check closing the quick slip for both afterprint orderings. Verify that an automatically printed spine label remains editable and can be manually reprinted without duplicate close calls. Automated tests: yarn cypress run --spec \ t/cypress/integration/Circulation/SlipPrinting_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nugged@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- I am reading in the comments that the value was 1000 before. Now we have 100. So this could be a bit too short? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #13 from Andrii Nugged <nugged@gmail.com> --- Thanks for checking this. The old 1000 ms timer was an unconditional fallback. The 100 ms timer starts only after the browser fires afterprint. It gives the browser a moment to finish handling that event before we close the slip window. With 100 ms, Firefox printed to PDF and closed the quick slip. The Cypress tests also passed when afterprint fired before or after print() returned. The test plan includes Print and Cancel in Firefox and Chromium so we can check that delay with the visible dialogs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44306 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com Status|Needs Signoff |Failed QA --- Comment #14 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I use Firefox and I tested - Print summary => OK - Print slip => OK - Print quick slip => OK - Print checkin slip => OK - Hold slip (Print slip and confirm) => OK - Spine label ==> NOT OK For the spine label, I tried in 25.05, the version before this "feature" was broken, and the window closes automatically after printing if you have SpineLabelAutoPrint on. If you don't have SpineLabelAutoPrint on, then you can edit the call number before printing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #15 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- *** Bug 44306 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #16 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212862&action=edit Bug 43114: Close the slip window after the print dialog Register the afterprint listener before calling print(), since the event can fire before print() returns. Wait 100 ms after afterprint so the browser can finish closing the dialog before closing the popup. Spine labels use the same handler when SpineLabelAutoPrint is enabled. With the preference disabled, the label opens as an editable preview and staff can choose when to print it. The custom IntranetSlipPrinterJS path is unchanged. Test plan: Before applying the patch: 1. Leave IntranetSlipPrinterJS empty and check out an item to a test patron. 2. In Firefox, use Print > Print quick slip from the checkout page. Print the slip and check whether the popup closes. Repeat with Cancel. Apply the patch. After applying the patch: 1. In Firefox and Chromium, repeat the quick slip with Print and Cancel. The popup closes after either action. 2. Enable SpineLabelAutoPrint. Open Cataloging > Quick spine label creator, enter the item barcode and click View spine label. 3. The print dialog opens automatically. Try Print and Cancel on separate attempts in each browser. The label popup closes each time. 4. Disable SpineLabelAutoPrint and open the same label in each browser. The preview opens without a print dialog. Click Edit this label and change its text. Click Print this label. Check the printed text. Reopen the preview and repeat the manual print with Cancel. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 --- Comment #17 from Andrii Nugged <nugged@gmail.com> --- Created attachment 212863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212863&action=edit Bug 43114: Add Cypress coverage for automatic slip printing Exercise the quick slip when afterprint fires before or after print() returns. Verify that an automatically printed spine label closes after the delay and that staff can edit the preview before printing when SpineLabelAutoPrint is disabled. Test plan: 1. Set up a Koha test database as for the existing Cypress tests. 2. Run t/cypress/integration/Circulation/SlipPrinting_spec.ts. 3. Verify all four tests pass. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212816|0 |1 is obsolete| | Attachment #212817|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43114 Andrii Nugged <nugged@gmail.com> 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=43114 --- Comment #18 from Andrii Nugged <nugged@gmail.com> --- Thanks to everyone who tested this and shared feedback. The revised series restores automatic closing for spine labels with auto-print enabled and preserves the editable preview with auto-print disabled. The 100 ms delay is unchanged. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org