[Bug 40158] New: SCO receipt doesnt print when SelfCheckReceiptPrompt is on
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Bug ID: 40158 Summary: SCO receipt doesnt print when SelfCheckReceiptPrompt is on Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Self checkout Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1. Have SelfCheckReceiptPrompt on 2. GO to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. No print dialogue -- 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=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36586 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36586 [Bug 36586] Self-checkouts will get CSRF errors if left inactive for 8 hours -- 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=40158 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 --- Comment #1 from Christopher Brannon <cbrannon@cdalibrary.org> --- I am suspect of the bug 36586 patch section that reads: [% IF Koha.Preference('SelfCheckReceiptPrompt') %] var confirmStart = Date.now(); confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) { - if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) { + if ( result && (Date.now() - confirmStart) < [% Koha.Preference('SelfCheckTimeout') | html %] ) { var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip"); location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; } else { location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; } }) - sco_init(); [% ELSE %] location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; [% END %] -- 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=40158 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- 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=40158 --- Comment #2 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Christopher, That looks like the right section: Prior to Bug 36586 there was this in the Perl file: $selfchecktimeout = C4::Context->preference('SelfCheckTimeout') * 1000; and then the following check with JS: if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) { that line was replaced with: if ( result && (Date.now() - confirmStart) < [% Koha.Preference('SelfCheckTimeout') | html %] ) { So now this will not evaluate to true. -- 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=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | Severity|major |minor -- 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=40158 --- Comment #3 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 183313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183313&action=edit Bug 40158: Multiply scotimeout x 1000 to restore old logic 1. Have SelfCheckReceiptPrompt on 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. No print dialogue 6. APPLY PATCH 7. Try again, it should behave as excepeted -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.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=40158 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- The patch looks like it does restore the old logic, but do we actually need the logic at all? I'll try with this patch and without that datetime handling at all. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183313|0 |1 is obsolete| | --- Comment #5 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 183314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183314&action=edit Bug 40158: Multiply scotimeout x 1000 to restore old logic 1. Have SelfCheckReceiptPrompt on 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. No print dialogue 6. APPLY PATCH 7. Try again, it should behave as excepeted Signed-off-by: Christopher <cbrannon@cdalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #6 from Christopher Brannon <cbrannon@cdalibrary.org> --- Works as described. Thanks for fixing this so quickly!!!!! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Created attachment 183315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183315&action=edit Bug 40158: [alternate] Remove unnecessary timeout check on sco slip print This change removes an unnecessary/buggy SelfCheckTimeout check when using SelfCheckReceiptPrompt slip printing. To test: 1. Have SelfCheckReceiptPrompt enabled 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. The print screen isn't shown and the user is just logged out 6. APPLY PATCH and refresh the page 7. Login and press 'Finish' then click "Print receipt and end session" 8. You should now see a print screen Notes: Set SelfCheckTimeout to a small value like 10 to see that not choosing an option for the SelfCheckReceiptPrompt will mean you're automatically logged out by the timer. If you do choose "Print receipt and end session", the original window will redirect to the logout endpoint, but it won't completely load until after the print screen is actioned - at least in Chrome. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Christopher and Lucas, could you try out my alternate patch? If there is some quirk to it that I can't see, I'm happy to go with Lucas's patch. But overall I don't see a point in having the old logic there either. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #8)
Christopher and Lucas, could you try out my alternate patch?
If there is some quirk to it that I can't see, I'm happy to go with Lucas's patch. But overall I don't see a point in having the old logic there either.
I've tested both and I think that they work the same? So I figure the less code the better? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lucas@bywatersolutions.com |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=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183314|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=40158 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183315|0 |1 is obsolete| | --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 183332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183332&action=edit Bug 40158: [alternate] Remove unnecessary timeout check on sco slip print This change removes an unnecessary/buggy SelfCheckTimeout check when using SelfCheckReceiptPrompt slip printing. To test: 1. Have SelfCheckReceiptPrompt enabled 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. The print screen isn't shown and the user is just logged out 6. APPLY PATCH and refresh the page 7. Login and press 'Finish' then click "Print receipt and end session" 8. You should now see a print screen Notes: Set SelfCheckTimeout to a small value like 10 to see that not choosing an option for the SelfCheckReceiptPrompt will mean you're automatically logged out by the timer. If you do choose "Print receipt and end session", the original window will redirect to the logout endpoint, but it won't completely load until after the print screen is actioned - at least in Chrome. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |RESOLVED Resolution|--- |DUPLICATE CC| |blawlor@clamsnet.org --- Comment #11 from Brendan Lawlor <blawlor@clamsnet.org> --- Bug 40108 has the same patch, except it also adds a semicolon to the end of the confirmModal function *** This bug has been marked as a duplicate of bug 40108 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183332|0 |1 is obsolete| | --- Comment #12 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 183347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183347&action=edit Bug 40158: [alternate] Remove unnecessary timeout check on sco slip print This change removes an unnecessary/buggy SelfCheckTimeout check when using SelfCheckReceiptPrompt slip printing. To test: 1. Have SelfCheckReceiptPrompt enabled 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. The print screen isn't shown and the user is just logged out 6. APPLY PATCH and refresh the page 7. Login and press 'Finish' then click "Print receipt and end session" 8. You should now see a print screen Notes: Set SelfCheckTimeout to a small value like 10 to see that not choosing an option for the SelfCheckReceiptPrompt will mean you're automatically logged out by the timer. If you do choose "Print receipt and end session", the original window will redirect to the logout endpoint, but it won't completely load until after the print screen is actioned - at least in Chrome. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Christopher <cbrannon@cdalibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40158 --- Comment #13 from David Cook <dcook@prosentient.com.au> --- (In reply to Brendan Lawlor from comment #11)
Bug 40108 has the same patch, except it also adds a semicolon to the end of the confirmModal function
*** This bug has been marked as a duplicate of bug 40108 ***
Nice one, Brendan! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org