Bug 36983

Summary: B_address_2 field is required even when not set to be required
Product: Koha Reporter: Matt Blenkinsop <matt.blenkinsop>
Component: OPACAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: david, fridolin.somers, lucas, wainuiwitikapark
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the patron self registration form. If the address field (B_address) in the alternative address section was set to required using the PatronSelfRegistrationBorrowerMandatoryField system preference, it was incorrectly making the address 2 field (B_address2) required on the form as well (even though it was not selected in the system preference).
Version(s) released in:
24.11.00,24.05.02,23.11.07
Circulation function:
Attachments: Bug 36983: Fix incorrect required class
Bug 36983: Fix incorrect required class
Bug 36983: Fix incorrect required class

Description Matt Blenkinsop 2024-05-29 11:06:00 UTC
In the self registration form the B_address2 field has the required class incorrectly set to match that of the B_address field and so acts as required even when not set to be required in PatronSelfRegistrationBorrowerMandatoryField
Comment 1 Matt Blenkinsop 2024-05-29 11:11:19 UTC
Created attachment 167238 [details] [review]
Bug 36983: Fix incorrect required class

This patch fixes an error on the B_address2 field which sets it to be required incorrectly

Test plan:
1) In PatronSelfRegistrationBorrowerMandatoryField, set B_address to be required.
2) In the OPAC, navigate to the self registration form.
3) In the Alternate address section, fill in the Address field that you have just set to be required. Ensure that you leave the Address 2 field blank.
4) Fill in all other required fields and submit the form, it should show you that the Address 2 field is required, even though it shouldn't be
5) Apply patch
6) Refresh the page and repeat steps 1-5, it should allow youto submit the form
Comment 2 Owen Leonard 2024-05-29 12:51:52 UTC
Created attachment 167240 [details] [review]
Bug 36983: Fix incorrect required class

This patch fixes an error on the B_address2 field which sets it to be
required incorrectly

Test plan:
1) In PatronSelfRegistrationBorrowerMandatoryField, set B_address to be
   required.
2) In the OPAC, navigate to the self registration form.
3) In the Alternate address section, fill in the Address field that you
   have just set to be required. Ensure that you leave the Address 2
   field blank.
4) Fill in all other required fields and submit the form, it should show
   you that the Address 2 field is required, even though it shouldn't be
5) Apply patch
6) Refresh the page and repeat steps 1-5, it should allow youto submit
   the form

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Martin Renvoize (ashimema) 2024-06-07 09:54:59 UTC
Created attachment 167566 [details] [review]
Bug 36983: Fix incorrect required class

This patch fixes an error on the B_address2 field which sets it to be
required incorrectly

Test plan:
1) In PatronSelfRegistrationBorrowerMandatoryField, set B_address to be
   required.
2) In the OPAC, navigate to the self registration form.
3) In the Alternate address section, fill in the Address field that you
   have just set to be required. Ensure that you leave the Address 2
   field blank.
4) Fill in all other required fields and submit the form, it should show
   you that the Address 2 field is required, even though it shouldn't be
5) Apply patch
6) Refresh the page and repeat steps 1-5, it should allow youto submit
   the form

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-06-11 07:14:26 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 5 Lucas Gass (lukeg) 2024-07-03 16:24:00 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 6 Fridolin Somers 2024-07-17 13:57:30 UTC
Pushed to 23.11.x for 23.11.07
Comment 7 Wainui Witika-Park 2024-07-19 03:25:25 UTC
not backporting to 23.05.x unless requested