Bug 40462

Summary: Preferred_name values distinct from firstname should not be lost when preferred_name set in BorrowerUnwantedFields
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle, mspinney
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40459
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Andrew Fuerste-Henry 2025-07-21 19:25:20 UTC
Current behavior:
- set a patron to have a preferred_name distinct from their firstname
- set BorrowerUnwantedField to hide preferred_name
- refresh your patron, confirm their preferred_name has not changed
- on your patron, click Edit and then Save without changing anything
- confirm your patron's preferred_name has been updated to match their firstname

In contrast, if you give a patron a fax number and then hide fax via borrowerunwantedfield, that fax number remains on the patron record and cannot be edited or removed by staff.

In preferred_name is included in BorrowerUnwantedField, we should only update preferred_name to match firstname if preferred_name and firstname matched before we edited the patron.