Bug 40783 - The bookbag_form should not be submittable
Summary: The bookbag_form should not be submittable
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-10 09:12 UTC by Jake Deery
Modified: 2025-10-06 10:30 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40783: Fix erroneous bookbag_form submission (1.55 KB, patch)
2025-09-10 09:13 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 40783: Result page checkbox now triggers click (1.90 KB, patch)
2025-09-23 11:11 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 40783: Result page checkbox now triggers click (1.94 KB, patch)
2025-10-01 15:10 UTC, Philip Orr
Details | Diff | Splinter Review
[ALTERNATIVE PATCH] Bug 40783: Use existing noEnterSubmit class (2.82 KB, patch)
2025-10-06 10:30 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Deery 2025-09-10 09:12:17 UTC
The bookbag_form on the OPAC search results page should not submit by default. This causes accessibility problems, as it appears as though a page refresh occurs needlessly.
Comment 1 Jake Deery 2025-09-10 09:13:58 UTC
Created attachment 186311 [details] [review]
Bug 40783: Fix erroneous bookbag_form submission

This patch addresses a bug where pressing return when focused on the
bookbag_form checkbox results in a form submission. The bookbag_form is
not designed to be submitted, so the behaviour has been disabled for
accessibility reasons.

TO TEST:
a)  go to /cgi-bin/koha/opac-search.pl?idx=kw&q=history&sort_by=relevance
b)  add an item to your cart (ensure the syspref is enabled)
c)  tab through the results until you come across a checkbox, press
return
d)  notice your page refresh, a form submission has happened
APPLY PATCH
e)  repeat steps a-c
f)  notice the page no longer refreshes, and that no form submission
occurs
g)  notice the items are still in your cart and can be interacted with
normally
SIGN OFF
Comment 2 Jake Deery 2025-09-23 11:11:57 UTC
Created attachment 186789 [details] [review]
Bug 40783: Result page checkbox now triggers click

This patch changes the behaviour off the checkboxes on the results page, so that instead of causing a form submission (essentially, a page refresh), the checkbox will now follow the same behaviour as if it were clicked.

TO TEST:
a)  go to /cgi-bin/koha/opac-search.pl?idx=kw&q=history&sort_by=relevance
b)  add an item to your cart (ensure the syspref is enabled)
c)  tab through the results until you come across a checkbox, press
return
d)  notice your page refreshes, as a form submission has happened
APPLY PATCH
e)  repeat steps a-c
f)  notice the page no longer refreshes, and that no form submission
occurs
g)  notice that the checkbox is now checked, as if it had been clicked
h)  notice the items are still in your cart and can be interacted with
normally
SIGN OFF
Comment 3 Jake Deery 2025-09-23 11:13:45 UTC
Slightly rewritten this patch, as the old one broke the sort_by dropdown on the results page.
Comment 4 Philip Orr 2025-10-01 14:40:40 UTC
Works for me, but qa fails tidiness:

´´´
Result:
[FAIL] koha-tmpl/opac-tmpl/bootstrap/js/results-list.js
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/opac-tmpl/bootstrap/js/results-list.js`
```

Happy to sign off anyway.
Also just to amend the patch notes:

Step e) repeat steps a-c
First you should clear your local cache and reload the page.
Otherwise the old js may be still cached :)
Comment 5 Philip Orr 2025-10-01 15:10:35 UTC
Created attachment 187201 [details] [review]
Bug 40783: Result page checkbox now triggers click

This patch changes the behaviour off the checkboxes on the results page, so that instead of causing a form submission (essentially, a page refresh), the checkbox will now follow the same behaviour as if it were clicked.

TO TEST:
a)  go to /cgi-bin/koha/opac-search.pl?idx=kw&q=history&sort_by=relevance
b)  add an item to your cart (ensure the syspref is enabled)
c)  tab through the results until you come across a checkbox, press
return
d)  notice your page refreshes, as a form submission has happened
APPLY PATCH
e)  repeat steps a-c
f)  notice the page no longer refreshes, and that no form submission
occurs
g)  notice that the checkbox is now checked, as if it had been clicked
h)  notice the items are still in your cart and can be interacted with
normally
SIGN OFF

Signed-off-by: John Doe <you@example.com>
Comment 6 Jonathan Druart 2025-10-06 10:30:21 UTC
Created attachment 187457 [details] [review]
[ALTERNATIVE PATCH] Bug 40783: Use existing noEnterSubmit class
Comment 7 Jonathan Druart 2025-10-06 10:30:47 UTC
Jake, please have a look at this patch, I think it's what you need here.