[Bug 14011] New: Triggering slip print with enter key collides with 'barcode submitted' message
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Bug ID: 14011 Summary: Triggering slip print with enter key collides with 'barcode submitted' message Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com, kyle@bywatersolutions.com To test: - submit empty checkout for triggering a slip print - print the slip or cancel - notice you can't read a new barcode into the field now, instead, the 'barcode submitted' message will be triggered each time you try -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13415 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #1 from Marc Véron <veron@veron.ch> --- Created attachment 38138 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38138&action=edit Bug 14011 - Triggering slip print with enter key collides with 'barcode submitted' To reproduce: - submit empty checkout for triggering a slip print - print the slip or cancel - notice you can't read a new barcode into the field now, instead, the 'barcode submitted' message will be triggered each time you try To test: - apply patch - try to reproduce issue -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38138|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 38148 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38148&action=edit Bug 14011 - Triggering slip print with enter key collides with 'barcode submitted' To reproduce: - Log into staff client - Find a client with 0 checkouts - Print a slip (or cancel printing it) - Attempt to type in a barcode to checkout -- annoying modal screen pops up 'barcode submitted' message will be triggered each time you try To test: - apply patch - try to reproduce issue Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 38148 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38148 Bug 14011 - Triggering slip print with enter key collides with 'barcode submitted' Review of attachment 38148: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=14011&attachment=38148) ----------------------------------------------------------------- ::: koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ +64,4 @@
$(document).ready(function() { $('#mainform').on('submit',function() { + if (barcode && barcode.value) {
What is the barcode variable? This variable is never defined, and you will never pass this condition. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #4 from Marc Véron <veron@veron.ch> --- Hi Jonathan, Add following alerts after line 66 in circulation.tt: $(document).ready(function() { $('#mainform').on('submit',function() { alert(barcode); alert(barcode.value); $('#barcode').on('keypress',function(event) { $('#barcodeSubmittedModal').modal(); event.preventDefault(); } ); }); (...) ...and then do checkout with a barcode e.g. 123456789 Result: With the first alert you will get [object HTMLInputELement] and with the second the barcode 123456789 While testing I detected errors because there seem to be cases where the object barcode does not (yet?) exist. That's why I test first for the existence of barcode and then for it's value. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38148|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38185 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38185&action=edit Bug 14011 - Triggering slip print with enter key collides with 'barcode submitted' To reproduce: - Log into staff client - Find a client with 0 checkouts - Print a slip (or cancel printing it) - Attempt to type in a barcode to checkout -- annoying modal screen pops up 'barcode submitted' message will be triggered each time you try To test: - apply patch - try to reproduce issue Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38186 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38186&action=edit Bug 14011: Make the jQuery selector explicit Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Marc Véron from comment #4)
Hi Jonathan,
Add following alerts after line 66 in circulation.tt:
$(document).ready(function() { $('#mainform').on('submit',function() { alert(barcode); alert(barcode.value); $('#barcode').on('keypress',function(event) { $('#barcodeSubmittedModal').modal(); event.preventDefault(); } ); }); (...)
It's seem that barcode and $("#barcode") is the same, I was not aware of that. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #8 from Marc Véron <veron@veron.ch> --- Thanks Jonathan for passing QA. BTW: I did some tests with $('#barcode') instead of barcode (see #4). The first alert showed [object Object] instead of [object HTMLInputELement] and the second 'undefined' instead of the value (and the patch did not work). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 --- Comment #9 from Marc Véron <veron@veron.ch> --- Re-tested with second patch, works as expected. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14011 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks Marc! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org