Bug 13089

Summary: Tab key triggers JavaScript error in the checkEnter function
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 13089 - Tab key triggers JavaScript error in the checkEnter function
[Signed-off] Bug 13089 - Tab key triggers JavaScript error in the checkEnter function
[PASSED QA] Bug 13089 - Tab key triggers JavaScript error in the checkEnter function

Description Owen Leonard 2014-10-15 16:27:50 UTC
Some input fields in Koha (the patron editor, for instance), have a class applied to them so that they will be "filtered" by the checkEnter function which prevents the enter key from submitting the form.

Tabbing between such input fields triggers a JavaScript error with each tab:

TypeError: e is undefined
/intranet-tmpl/prog/en/js/staff-global.js
Line 62
Comment 1 Owen Leonard 2014-10-15 16:47:42 UTC Comment hidden (obsolete)
Comment 2 Frédéric Demians 2014-10-25 12:08:34 UTC
I can see the bug in FF, and confirm that your patch fix it. But I can't see it neither if IE nor in Chrome (Ubuntu & Windows).
Comment 3 Owen Leonard 2014-10-25 15:24:40 UTC
(In reply to Frédéric Demians from comment #2)
> But I can't see
> it neither if IE nor in Chrome (Ubuntu & Windows).

If there is no error in any of those browsers after applying the patch and following the test plan then it sound like it's working correctly.
Comment 4 Marc Véron 2014-10-29 21:46:38 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2014-10-30 00:05:31 UTC
Created attachment 32955 [details] [review]
[PASSED QA] Bug 13089 - Tab key triggers JavaScript error in the checkEnter function

Tabbing through fields in the patron add form or MARC editor triggers a
JavaScript error for each tab. The cause seems to be some JS which was
designed to accommodate differences between Mozilla browsers and
Internet Explorer. A slight modification seems to work just as well in
Firefox and IE.

To test, apply the patch and clear your browser cache if necessary. To
look for JavaScript errors, open the Developer Tools console in Firefox,
Chrome, or Internet Explorer (or in Firefox's Firebug console).

Create a new patron and use the tab key to move between inputs. No error
should be reported in the console. Test typing in fields and pressing
enter. The form should not be submitted.

Test in all available browsers, including at least IE11, IE10, and IE9.

Reproduced with FF 32
Tested with FF 32, Chrome 38, IE 11 and IE Emulations 8,9,10
No JavaScript errors found. Enter does not submit.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested in Chromium, confirmed the problem and that the patch fixes it.
Passes tests and QA script.
Comment 6 Tomás Cohen Arazi (tcohen) 2014-11-07 18:23:05 UTC
Patch pushed to master.

Thanks Owen!