Bug 41202 - Remove the 'negcap' field from the OPAC purchase suggestion form
Summary: Remove the 'negcap' field from the OPAC purchase suggestion form
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-06 09:37 UTC by Jake Deery
Modified: 2025-11-08 00:59 UTC (History)
4 users (show)

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


Attachments
Bug 41202: Remove hidden negcap for accessibility (2.93 KB, patch)
2025-11-06 09:45 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 41202: Remove hidden negcap for accessibility (2.96 KB, patch)
2025-11-08 00:35 UTC, David Nind
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-11-06 09:37:43 UTC
On the opac-suggestions page, there is a visually hidden negcap field. It is terrible for accessibility, and seems only to exist to halt bots – which seems unnecessary, given how this page requires users to log in anyway.

I propose we remove this field entirely, with possible future development to use some other sort of captcha on this page, if it is deemed necessary.
Comment 1 Jake Deery 2025-11-06 09:45:58 UTC
Created attachment 189151 [details] [review]
Bug 41202: Remove hidden negcap for accessibility

This patch removes the negcap field on opac-suggestions, as it serves no
purpose other than to confuse screen readers. If ncessary, it should be
replaced in a follow-up patch with a visually accessible captcha field.

== TO TEST ==
a)  go to /cgi-bin/koha/opac-suggestions.pl?op=add_form&biblionumber=56
b)  notice as you tab through the form, the focus caret seems to disappear
c)  inspect the code, and see the negcap field
d)  complete and submit the form successfully
== APPLY PATCH ==
e)  repeat steps a-d
f)  notice tabbing now works correctly
g)  notice the negcap field is no longer present
h)  the form should still successfully submit
== SIGN OFF ==
Comment 2 David Nind 2025-11-08 00:35:18 UTC
Created attachment 189380 [details] [review]
Bug 41202: Remove hidden negcap for accessibility

This patch removes the negcap field on opac-suggestions, as it serves no
purpose other than to confuse screen readers. If ncessary, it should be
replaced in a follow-up patch with a visually accessible captcha field.

== TO TEST ==
a)  go to /cgi-bin/koha/opac-suggestions.pl?op=add_form&biblionumber=56
b)  notice as you tab through the form, the focus caret seems to disappear
c)  inspect the code, and see the negcap field
d)  complete and submit the form successfully
== APPLY PATCH ==
e)  repeat steps a-d
f)  notice tabbing now works correctly
g)  notice the negcap field is no longer present
h)  the form should still successfully submit
== SIGN OFF ==

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-11-08 00:58:36 UTC
I've signed off, as what is in the test plan works.

However, if anonymous suggestions are allowed (AnonSuggestions = Allow, and AnonymousPatron set (for example, to 19), then the 'negcap' field is also removed from teh form.

Testing notes (using KTD):

1. The hidden field is between the 'Notes' and 'Submit your suggestion' fields. When you tab from notes to submit, tab twice to get the submit field to be selected.

2. If you inspect the source before the patch, you will see this HTML markup (after the patch, it is no longer there):

<!--  Add a hidden 'negcap' field -->
<li id="negcap" style="position: absolute; left: -2000px;"> negcap 
<input type="text" name="negcap"> 
</li>