Bug 41638

Summary: Patron record field labels lack distinct id in HTML
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: TemplatesAssignee: Lisette Scheer <lisette>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, emmi.takkinen, lisette
Version: MainKeywords: Academy
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small 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
Bug 41638: Add IDs to labels on patron edit
Bug 41638: (follow-up) Fix more instances, some markup errors
Bug 41638: Add IDs to labels on patron edit
Bug 41638: (follow-up) Fix more instances, some markup errors
Bug 41638: Add IDs to labels on patron edit
Bug 41638: (follow-up) Fix more instances, some markup errors

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!
Comment 2 Owen Leonard 2026-01-22 18:41:33 UTC
Created attachment 191878 [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!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Owen Leonard 2026-01-22 18:41:36 UTC
Created attachment 191879 [details] [review]
Bug 41638: (follow-up) Fix more instances, some markup errors

I've added changes for member-alt-address-style.inc,
member-alt-contact-style.inc, and member-main-address-style.inc.

I've also made some related markup corrections: Missing ID on some
inputs, incorrect "for" label on some labels. These fixes don't correct
*all* validation errors but it's an improvement.
Comment 4 Emmi Takkinen 2026-02-06 09:06:39 UTC
Applying patches fails on merge conflict.
Comment 5 Owen Leonard 2026-02-06 14:19:14 UTC
Created attachment 192616 [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!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2026-02-06 14:19:17 UTC
Created attachment 192617 [details] [review]
Bug 41638: (follow-up) Fix more instances, some markup errors

I've added changes for member-alt-address-style.inc,
member-alt-contact-style.inc, and member-main-address-style.inc.

I've also made some related markup corrections: Missing ID on some
inputs, incorrect "for" label on some labels. These fixes don't correct
*all* validation errors but it's an improvement.
Comment 7 Emmi Takkinen 2026-02-09 08:37:43 UTC
Created attachment 192712 [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!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Comment 8 Emmi Takkinen 2026-02-09 08:38:10 UTC
Created attachment 192713 [details] [review]
Bug 41638: (follow-up) Fix more instances, some markup errors

I've added changes for member-alt-address-style.inc,
member-alt-contact-style.inc, and member-main-address-style.inc.

I've also made some related markup corrections: Missing ID on some
inputs, incorrect "for" label on some labels. These fixes don't correct
*all* validation errors but it's an improvement.

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>