Bug 14880 - Keyboard shortcuts don't work after setting CircAutocompl to "Don't try"
Summary: Keyboard shortcuts don't work after setting CircAutocompl to "Don't try"
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Lari Taskula
QA Contact: Testopia
URL:
Keywords:
: 14860 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-22 21:11 UTC by Tim McMahon
Modified: 2016-06-21 21:38 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14880: Keyboard shortcuts don't work after setting CircAutocompl to "Don't try" (2.08 KB, patch)
2015-09-25 14:20 UTC, Lari Taskula
Details | Diff | Splinter Review
[Signed-off] Bug 14880: Keyboard shortcuts don't work after setting CircAutocompl to "Don't try" (2.27 KB, patch)
2015-09-29 08:36 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 14880: Keyboard shortcuts don't work after setting CircAutocompl to "Don't try" (2.32 KB, patch)
2015-09-30 21:51 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tim McMahon 2015-09-22 21:11:00 UTC
Setting CircAutocompl to "Don't try" will cause the keyboard shortcuts in the staff interface to select incorrect tabs on the search form.

Examples are:

On the start page (mainpage.pl):
Alt+u = Search the catalog
Alt+r = Check out
Alt+q = Search patrons

On circulation-home.pl:
Alt+q = Check in and the other two keys are the same.

This is the behavior reported in bug 14860.
Comment 1 Tim McMahon 2015-09-22 21:11:52 UTC
*** Bug 14860 has been marked as a duplicate of this bug. ***
Comment 2 Lari Taskula 2015-09-25 14:20:24 UTC Comment hidden (obsolete)
Comment 3 Lari Taskula 2015-09-28 09:34:40 UTC
See also bug 14829 if the test plan above fails in Patrons/Cataloging modules.
Comment 4 Marc Véron 2015-09-29 08:36:47 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2015-09-30 21:51:52 UTC
Created attachment 42982 [details] [review]
[PASSED QA] Bug 14880: Keyboard shortcuts don't work after setting CircAutocompl to "Don't try"

The issue is that CircAutocompl loads a script element under #header_search
element. When this element is missing, it also messes up the indexing,
because we were calculating the indexing of the found element by subtracting
one from the found element's index (to eliminate the <script> element).

Thats why the shortcut key problem in this bug takes you one too to the left,
because we are still subtracting one from the index even though there is no
<script> element anymore.

This patches selects only the div elements and gets the index from them.
No subtractions needed.

To test keys:
1. Set CircAutocompl system preference to Don't try.
2. Try the shortcut keys. They will work incorrectly like this:
   Alt+U = Search catalogue
   Alt+R = Check out
   Alt+Q = Check in
3. Set CircAutocompl system preference to Try.
4. Try the shortcut keys. They will work correctly like this:
   Alt+U = Check out
   Alt+R = Check in
   ALt+Q = Search catalogue
5. Apply patch
6. Repeat step 1 and 4.
7. Repeat step 3 and 4.
8. Observe that regardless of CircAutocompl, shortcut keys worked correctly.

Followed test plan, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi 2015-10-02 18:28:01 UTC
Patch pushed to master.

Thanks Lari!
Comment 7 Chris Cormack 2015-10-23 12:55:15 UTC
Pushed to 3.20.x will be in 3.20.5