Bug 41638 - Patron record field labels lack distinct id in HTML
Summary: Patron record field labels lack distinct id in HTML
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lisette Scheer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-15 16:04 UTC by Andrew Fuerste-Henry
Modified: 2026-01-15 17:10 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: String patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds ids to all the labels on memberentry.pl with the convention of <label for="surname" id="surname_label"> for easier jquery selection.
Version(s) released in:
Circulation function:


Attachments
Bug 41638: Add IDs to labels on patron edit (61.36 KB, patch)
2026-01-15 17:09 UTC, Lisette Scheer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2026-01-15 16:04:08 UTC
Libraries commonly use jQuery to reword the labels on various fields in the patron record (like changing "Surname" to "Last name"). Those field labels lack distinct IDs, which makes targeting them with jQuery more complicated and fragile:

  $('.label:contains("Surname")').text('Last name:');
  $('label[for="surname"]').text("Last name:");

If that label had an ID like "#surname_label" it would simplify things.
Comment 1 Lisette Scheer 2026-01-15 17:09:19 UTC
Created attachment 191519 [details] [review]
Bug 41638: Add IDs to labels on patron edit

When targeting with jquery and css, labels on the patron edit screen can be fragile and complicated.
This patch adds ids to all the labels that follow the following convention:

<label for="surname" class="required" id="surname_label">

Each id is the "for" with _label appended.

To Test:
1. Before applying the patch, go to add a new patron
2. Right click on the page and use the browser inspector/inspect element.
3. Observe there are no ids for the field labels.
4. Apply patch
5. Reload the page
6. Observe there are now ids for the fields.
7. Go through all the fields and confirm there is an id and that they follow the convention above.
8. Change mandatory fields and confirm the labels are still correct.
9. Edit an existing patron and confirm the ids are still present.
10. Sign off!