Bug 28633 - Add a preferred_name field and an effective_name method to patrons
Summary: Add a preferred_name field and an effective_name method to patrons
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords: Manual, release-notes-needed
Depends on:
Blocks:
 
Reported: 2021-06-25 19:29 UTC by Nick Clemens
Modified: 2024-03-13 05:01 UTC (History)
13 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 28633: DB Update (1.64 KB, patch)
2021-07-21 11:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (5.67 KB, patch)
2021-07-21 11:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (19.57 KB, patch)
2021-07-21 11:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (19.57 KB, patch)
2021-08-09 18:26 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DB Update (2.09 KB, patch)
2021-09-30 12:55 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (4.08 KB, patch)
2021-09-30 12:55 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (19.57 KB, patch)
2021-09-30 12:55 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (follow-up) Show legal name and add preferredname to searches (8.08 KB, patch)
2021-09-30 12:55 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (follow-up) Show first name and add preferredname to searches (8.16 KB, patch)
2021-10-20 14:24 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DB update (6.53 KB, patch)
2022-01-03 15:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (20.44 KB, patch)
2022-01-03 15:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (4.08 KB, patch)
2022-01-03 15:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DB update (6.59 KB, patch)
2022-01-31 10:55 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (20.52 KB, patch)
2022-01-31 10:55 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (4.15 KB, patch)
2022-01-31 10:55 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: DB update (5.89 KB, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (21.51 KB, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: (follow-up) Account for bug 29695 changes (3.47 KB, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: (follow-up) Account for changes with bug 30063 (1.91 KB, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (4.14 KB, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: (QA follow-up) Add preferred_name to ysearch (1021 bytes, patch)
2022-04-20 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28633: (follow-up) Display effective name in JS search (3.63 KB, patch)
2022-04-20 10:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DB update (5.89 KB, patch)
2022-04-26 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Add preferred name field to patrons (21.51 KB, patch)
2022-04-26 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (follow-up) Account for bug 29695 changes (3.47 KB, patch)
2022-04-26 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (follow-up) Account for changes with bug 30063 (1.91 KB, patch)
2022-04-26 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (QA follow-up) Add preferred_name to ysearch (1021 bytes, patch)
2022-04-26 16:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: (follow-up) Display effective name in JS search (3.63 KB, patch)
2022-04-26 16:34 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: DO NOT PUSH Schema Changes (4.07 KB, patch)
2022-04-26 16:34 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28633: Fix ysearch sorting (3.13 KB, patch)
2022-04-26 16:34 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-06-25 19:29:04 UTC
Some institutions store legal names in their directories and for patron imports, but would also like to be able to record 'preferred' names in the patro records.

It would be nice to have a field for preferred_name and a method to select the preferred name when it exists, and the firstname when it doesn't

Following the item we would suggest 'effective_name' - the additional method can be used in patron-title.inc and in notices to simplify name choice.
Comment 1 Lisette Scheer 2021-06-28 17:29:48 UTC
Yes, this would be lovely. We use the "Other Name" field sort of like this and train staff to use the other name. 

I'm currently working on updating our notices with TT to send the other name instead of first name if it is present but that doesn't help on the OPAC side where a patron will still see their legal name. 

Lisette
Comment 2 David Cook 2021-06-29 01:02:32 UTC
We've certainly had libraries ask for something like this, although it would also need to take into account patron searching, as I've had librarians say they want to be able to search for patrons using their preferred name rather than their legal name.
Comment 3 Nick Clemens 2021-07-21 11:14:50 UTC
Created attachment 123008 [details] [review]
Bug 28633: DB Update
Comment 4 Nick Clemens 2021-07-21 11:14:54 UTC
Created attachment 123009 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes
Comment 5 Nick Clemens 2021-07-21 11:14:57 UTC
Created attachment 123010 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferredname' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

To test:
1 - Apply patches
2 - Update database and restart all, clear browser cache
3 - Load a patron in staff module
4 - Confirm you see and can add a preferred name
5 - Confirm the preferred name now displays on patron details
6 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
    new field required or hidden
7 - Sign in as patron to opac
8 - Confirm preferred name shows
9 - Edit account on opac and confirm field is present
Comment 6 Andrew Fuerste-Henry 2021-07-22 12:27:20 UTC
With the patch applied, patron first names do not appear in the patronbriefintro sidebar on the left or in the "Checking out to [Patron name]" box on the Check out tab, even when preferred name is NULL or blank.
Comment 7 Nick Clemens 2021-08-09 18:26:53 UTC
Created attachment 123658 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferredname' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

To test:
1 - Apply patches
2 - Update database and restart all, clear browser cache
3 - Load a patron in staff module
4 - Confirm you see and can add a preferred name
5 - Confirm the preferred name now displays on patron details
6 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
    new field required or hidden
7 - Sign in as patron to opac
8 - Confirm preferred name shows
9 - Edit account on opac and confirm field is present
Comment 8 Lisette Scheer 2021-08-10 15:32:52 UTC
Signed off in the Bywater Sandbox. 
I also checked and you can still search by first name. 
I do think it's a little strange that the only place to see the first name on the staff client is by editing the patron. Might be confusing if someone is trying to figure out why a patron came up in a search. 

Excited for this!

Lisette
Comment 9 Martin Renvoize 2021-09-30 11:06:47 UTC
I can't see that one can search on the new preferred name.. I think that's a must for this.

I also find it a little confusing on the patron page.. I think I'd actually prefer to display 'Legal name' as a distinct and clear field if we're falling through to preferred name for the main display.

We also don't appear to catch the the dropdown for 'PatronAutoComplete'.

Sorry dude.. I think this is a great start, but it need a little more work ;)
Comment 10 Nick Clemens 2021-09-30 12:55:43 UTC
Created attachment 125497 [details] [review]
Bug 28633: DB Update
Comment 11 Nick Clemens 2021-09-30 12:55:46 UTC
Created attachment 125498 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes
Comment 12 Nick Clemens 2021-09-30 12:55:50 UTC
Created attachment 125499 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferredname' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

To test:
1 - Apply patches
2 - Update database and restart all, clear browser cache
3 - Load a patron in staff module
4 - Confirm you see and can add a preferred name
5 - Confirm the preferred name now displays on patron details
6 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
    new field required or hidden
7 - Sign in as patron to opac
8 - Confirm preferred name shows
9 - Edit account on opac and confirm field is present
Comment 13 Nick Clemens 2021-09-30 12:55:53 UTC
Created attachment 125500 [details] [review]
Bug 28633: (follow-up) Show legal name and add preferredname to searches

This patch adds to the DB update a condition to add 'preferredname' to
DefaultPatronSearchFields. It also adjust the koha defaults to include it
if the pref is empty

The 'firstname' is displayed as 'Legal name' on the details page, with id/class
to allow ajusting via JS/CSS

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
1 - Aply patches and updatedatabase and restart_all
2 - Add a preferredname to a patron
3 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
    Add preferredname if not
4 - Perform checkout and patron search using preferredname, confirm patron is found
5 - On patron's detail page confirm 'Legal name' shows
6 - Remove patron's first name, confirm 'Legal name' is no longer present
7 - Enable PatronAutoComplete system preference
8 - Type patron's surname into Checkout or patron search but don't hit enter
9 - Confirm patron is dsiplayed with 'preferredname' in the preview
Comment 14 David Cook 2021-10-05 01:16:53 UTC
I'm not sure what I think about "Legal name" in this context. 

I suppose if there are any cases where they have something other than their legal name in first name when also using a preferred name it just becomes a data problem which can be fixed...
Comment 15 Nick Clemens 2021-10-19 15:41:15 UTC
(In reply to David Cook from comment #14)
> I'm not sure what I think about "Legal name" in this context. 
> 
> I suppose if there are any cases where they have something other than their
> legal name in first name when also using a preferred name it just becomes a
> data problem which can be fixed...

"Given name"? Or should it just remain 'First name'?
Comment 16 David Cook 2021-10-20 03:52:58 UTC
(In reply to Nick Clemens from comment #15)
> (In reply to David Cook from comment #14)
> > I'm not sure what I think about "Legal name" in this context. 
> > 
> > I suppose if there are any cases where they have something other than their
> > legal name in first name when also using a preferred name it just becomes a
> > data problem which can be fixed...
> 
> "Given name"? Or should it just remain 'First name'?

Personally I think it should remain 'First name', but I'm not an expert on name terminology either heh.
Comment 17 Katrin Fischer 2021-10-20 07:21:31 UTC
A rename here would have quite a lot of consequences for documentation and such. I see a potential issue with confusing people by having a lot of different name variations and options. I think keeping the 'first name' would be good.
Comment 18 Andrew Fuerste-Henry 2021-10-20 12:05:07 UTC
(In reply to Katrin Fischer from comment #17)
> A rename here would have quite a lot of consequences for documentation and
> such. I see a potential issue with confusing people by having a lot of
> different name variations and options. I think keeping the 'first name'
> would be good.

Another +1 for "first name."
Comment 19 Nick Clemens 2021-10-20 14:24:05 UTC
Created attachment 126591 [details] [review]
Bug 28633: (follow-up) Show first name and add preferredname to searches

This patch adds to the DB update a condition to add 'preferredname' to
DefaultPatronSearchFields. It also adjust the koha defaults to include it
if the pref is empty

The 'firstname' is displayed as 'First name' on the details page, with id/class
patron_first_name to allow ajusting via JS/CSS if library wants to highlight/hide
the non-preferred name

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
1 - Apply patches and updatedatabase and restart_all
2 - Add a preferredname to a patron
3 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
    Add preferredname if not
4 - Perform checkout and patron search using preferredname, confirm patron is found
5 - On patron's detail page confirm 'First name' shows
6 - Remove patron's first name, confirm 'First name' is no longer present
7 - Enable PatronAutoComplete system preference
8 - Type patron's surname into Checkout or patron search but don't hit enter
9 - Confirm patron is dsiplayed with 'preferredname' in the preview
Comment 20 Tomás Cohen Arazi 2021-10-20 14:45:38 UTC
Nick,
1. You need to either exclude the attribute from the API (preferredname => undef in Koha::Patron::to_api_mapping) or add a mapping for it, and add it also to definitions/patron.json
2. I suggest you name the column preferred_name to avoid the need for any mapping :-D

Failing because it is breaking the API as-is.
Comment 21 Nick Clemens 2022-01-03 15:33:34 UTC
Created attachment 128968 [details] [review]
Bug 28633: DB update

This adds the field to necessary tables and updates API and columns def
Comment 22 Nick Clemens 2022-01-03 15:33:38 UTC
Created attachment 128969 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferred_name' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

The 'firstname' is displayed as 'First name' on the details page, with id/class
patron_first_name to allow ajusting via JS/CSS if library wants to highlight/hide
the non-preferred name

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
 1 - Apply patches
 2 - Update database and restart all, clear browser cache
 3 - Load a patron in staff module
 4 - Confirm you see and can add a preferred name
 5 - Confirm the preferred name and first name now displays on patron details
 6 - Remove first name from patron record and confirm it no longer shows
 7 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
     new field required or hidden
 8 - Sign in as patron to opac
 9 - Confirm preferred name shows
10 - Edit account on opac and confirm field is present
11 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
12 - Perform checkout and patron search using preferred_name, confirm patron is found
13 - Enable PatronAutoComplete system preference
14 - Type patron's surname into Checkout or patron search but don't hit enter
15 - Confirm patron is displayed with 'preferred_name' in the preview
Comment 23 Nick Clemens 2022-01-03 15:33:42 UTC
Created attachment 128970 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes
Comment 24 Martin Renvoize 2022-01-31 10:35:01 UTC
Coming back to this... sorry for the hiatus. First name works fine and I agree with all the reasoning given, well argued :)

A quick test run and I'll SO.. the code all looks good to me :)
Comment 25 Martin Renvoize 2022-01-31 10:55:47 UTC
Created attachment 130000 [details] [review]
Bug 28633: DB update

This adds the field to necessary tables and updates API and columns def

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 26 Martin Renvoize 2022-01-31 10:55:53 UTC
Created attachment 130001 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferred_name' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

The 'firstname' is displayed as 'First name' on the details page, with id/class
patron_first_name to allow ajusting via JS/CSS if library wants to highlight/hide
the non-preferred name

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
 1 - Apply patches
 2 - Update database and restart all, clear browser cache
 3 - Load a patron in staff module
 4 - Confirm you see and can add a preferred name
 5 - Confirm the preferred name and first name now displays on patron details
 6 - Remove first name from patron record and confirm it no longer shows
 7 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
     new field required or hidden
 8 - Sign in as patron to opac
 9 - Confirm preferred name shows
10 - Edit account on opac and confirm field is present
11 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
12 - Perform checkout and patron search using preferred_name, confirm patron is found
13 - Enable PatronAutoComplete system preference
14 - Type patron's surname into Checkout or patron search but don't hit enter
15 - Confirm patron is displayed with 'preferred_name' in the preview

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 27 Martin Renvoize 2022-01-31 10:55:58 UTC
Created attachment 130002 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 28 Martin Renvoize 2022-01-31 11:01:25 UTC
This works nicely now; To me, the name appears in the right places, looks good and isn't confusing and is searchable where one would expect it to be.

So.. signing off on that front.

It did make me take a look at some of the other name fields in patrons though, and that, I found, confusing.

'othernames' appears to partially try to do what this patch does (I'd always thought of it as 'middle names', but I note that othernames actually appears at the top of the 'contact information in double-quotes and not aligned with the rest of the information and with no label.  I also find it slightly strange that 'lastname' doesn't appear in that contact information block.

So.. in short.. I like this patch, but would like to see a little effort go into tidying up the members display data in some future bugs.. perhaps Owen could help there.?
Comment 29 Martin Renvoize 2022-02-18 11:15:00 UTC
See also bug 21978 where people are requesting 'middlename' get added as another field too.
Comment 30 Katrin Fischer 2022-03-27 14:17:41 UTC
I had to do a rebase for a conflict in Patrons.t and recreate the schema files locally.

Overall this works really really well already!

1) Tiny typo
+    description: patron's preferred named

2) Patron search results

In patron search results I still see the "firstname" instead of the "preferred name". 

This seems a little confusing, as this is the only place now showing the firstname. On the other hand, if someone presents an ID and I want to search forthem, I will need to make the connection. Maybe we could display the preferred name additionally to the firstname somehow?

3) Auto-complete for patrons

When I type "Cait" the entry doesn't show, only when I type "Katrin". But in the preview, it shows 'Cait' ... So there is a mismatch with what you need to type and what will show.

I am not sure how to resolve this, but maybe you have an idea or can explain reasoning?
Comment 31 Martin Renvoize 2022-04-20 10:20:08 UTC
Created attachment 133445 [details] [review]
Bug 28633: DB update

This adds the field to necessary tables and updates API and columns def

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 32 Martin Renvoize 2022-04-20 10:20:13 UTC
Created attachment 133446 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferred_name' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

The 'firstname' is displayed as 'First name' on the details page, with id/class
patron_first_name to allow ajusting via JS/CSS if library wants to highlight/hide
the non-preferred name

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
 1 - Apply patches
 2 - Update database and restart all, clear browser cache
 3 - Load a patron in staff module
 4 - Confirm you see and can add a preferred name
 5 - Confirm the preferred name and first name now displays on patron details
 6 - Remove first name from patron record and confirm it no longer shows
 7 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
     new field required or hidden
 8 - Sign in as patron to opac
 9 - Confirm preferred name shows
10 - Edit account on opac and confirm field is present
11 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
12 - Perform checkout and patron search using preferred_name, confirm patron is found
13 - Enable PatronAutoComplete system preference
14 - Type patron's surname into Checkout or patron search but don't hit enter
15 - Confirm patron is displayed with 'preferred_name' in the preview

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 33 Martin Renvoize 2022-04-20 10:20:18 UTC
Created attachment 133447 [details] [review]
Bug 28633: (follow-up) Account for bug 29695 changes

During rebase of this patchset we drop the columns.def and
borrowers.json changes introduced.

We store this mapping in the module now, so this patch does
that.
Comment 34 Martin Renvoize 2022-04-20 10:20:23 UTC
Created attachment 133448 [details] [review]
Bug 28633: (follow-up) Account for changes with bug 30063

Bug 30063 removes the C4/Utils/DataTables/Members.pm module and instead
uses the API and a patron-search include to define the default search
fields. This follow-up adds preferred_name into the default fields in
that include now the the module has been removed
Comment 35 Martin Renvoize 2022-04-20 10:20:28 UTC
Created attachment 133449 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 36 Martin Renvoize 2022-04-20 10:20:33 UTC
Created attachment 133450 [details] [review]
Bug 28633: (QA follow-up) Add preferred_name to ysearch

This adds preferred_name to the search fields in the autocomplete search
system.
Comment 37 Martin Renvoize 2022-04-20 10:23:46 UTC
This is mostly a rebase taking into account bug 29695 and bug 30063.  I also added a QA follow-up to allow searching on the preferred name in the autocomplete searches.

I'm not entirely sure about the complete replacement of firstname with preferred_name everywhere.. it can lead to confusion in a few places as Katrin suggests... with the discussion on bug 21978 which lead to me opening bug 30568 I think this could play a bigger part here too.
Comment 38 Nick Clemens 2022-04-20 10:38:33 UTC
Created attachment 133451 [details] [review]
Bug 28633: (follow-up) Display effective name in JS search

Also I fix the other header  search, and ensure the 'Standard' option wil appear in dropdowns
Comment 39 Nick Clemens 2022-04-20 10:46:06 UTC
(In reply to Katrin Fischer from comment #30)
> 1) Tiny typo
> +    description: patron's preferred named

I am not sure where you are referring to

> 2) Patron search results
> 
> In patron search results I still see the "firstname" instead of the
> "preferred name". 

Fixed

> 
> This seems a little confusing, as this is the only place now showing the
> firstname. On the other hand, if someone presents an ID and I want to search
> forthem, I will need to make the connection. Maybe we could display the
> preferred name additionally to the firstname somehow?

Preferred name is meant to be stronger than 'othernames' - it is how the patron wants to be addressed - I think in the case where there is a difference with an ID they will tell you which name to expect
 
> 3) Auto-complete for patrons
> 
> When I type "Cait" the entry doesn't show, only when I type "Katrin". But in
> the preview, it shows 'Cait' ... So there is a mismatch with what you need
> to type and what will show.

Martin fixed this

> I am not sure how to resolve this, but maybe you have an idea or can explain
> reasoning?

As above, the idea is that a preferred name is intended to the name a patron wants to be called. It is the case where the patron is not using their first name, but may still legally have that name. If a patron is using a nickname, that would be 'othernames'
Comment 40 Martin Renvoize 2022-04-20 11:46:53 UTC
(In reply to Nick Clemens from comment #39)
> (In reply to Katrin Fischer from comment #30)
> > 1) Tiny typo
> > +    description: patron's preferred named
> 
> I am not sure where you are referring to

I fixed it inline 'named -> name'
Comment 41 Katrin Fischer 2022-04-26 15:03:15 UTC
Can you please rebase?

Careful with the first conflict - h3 changed to h1 in master and the section was moved a little downwards.
Comment 42 Nick Clemens 2022-04-26 16:33:36 UTC
Created attachment 133958 [details] [review]
Bug 28633: DB update

This adds the field to necessary tables and updates API and columns def

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 43 Nick Clemens 2022-04-26 16:33:41 UTC
Created attachment 133959 [details] [review]
Bug 28633: Add preferred name field to patrons

This patch adds a new field 'preferred_name' to the patron record.

Additionally it adds a method 'effective_name' to choose the preferred name if present
and fall back to firstname

The 'firstname' is displayed as 'First name' on the details page, with id/class
patron_first_name to allow ajusting via JS/CSS if library wants to highlight/hide
the non-preferred name

PatronAutoComplete/ysearch is updated to use 'effective_name' method

To test:
 1 - Apply patches
 2 - Update database and restart all, clear browser cache
 3 - Load a patron in staff module
 4 - Confirm you see and can add a preferred name
 5 - Confirm the preferred name and first name now displays on patron details
 6 - Remove first name from patron record and confirm it no longer shows
 7 - Edit sysprefs BorrowerMandatoryFields and BorrowerUnwantedFields to confirm you can make
     new field required or hidden
 8 - Sign in as patron to opac
 9 - Confirm preferred name shows
10 - Edit account on opac and confirm field is present
11 - Verify DefaultPatronSearchFields contains 'preferredname' if your pref had firstname
12 - Perform checkout and patron search using preferred_name, confirm patron is found
13 - Enable PatronAutoComplete system preference
14 - Type patron's surname into Checkout or patron search but don't hit enter
15 - Confirm patron is displayed with 'preferred_name' in the preview

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 44 Nick Clemens 2022-04-26 16:33:45 UTC
Created attachment 133960 [details] [review]
Bug 28633: (follow-up) Account for bug 29695 changes

During rebase of this patchset we drop the columns.def and
borrowers.json changes introduced.

We store this mapping in the module now, so this patch does
that.
Comment 45 Nick Clemens 2022-04-26 16:33:50 UTC
Created attachment 133961 [details] [review]
Bug 28633: (follow-up) Account for changes with bug 30063

Bug 30063 removes the C4/Utils/DataTables/Members.pm module and instead
uses the API and a patron-search include to define the default search
fields. This follow-up adds preferred_name into the default fields in
that include now the the module has been removed
Comment 46 Nick Clemens 2022-04-26 16:33:55 UTC
Created attachment 133962 [details] [review]
Bug 28633: (QA follow-up) Add preferred_name to ysearch

This adds preferred_name to the search fields in the autocomplete search
system.
Comment 47 Nick Clemens 2022-04-26 16:34:00 UTC
Created attachment 133963 [details] [review]
Bug 28633: (follow-up) Display effective name in JS search

Also I fix the other header  search, and ensure the 'Standard' option wil appear in dropdowns
Comment 48 Nick Clemens 2022-04-26 16:34:04 UTC
Created attachment 133964 [details] [review]
Bug 28633: DO NOT PUSH Schema Changes
Comment 49 Nick Clemens 2022-04-26 16:34:12 UTC
Created attachment 133965 [details] [review]
Bug 28633: Fix ysearch sorting

This adds an IF conditional to the sorting to sort by preferred name or firstname

I add the colmns to data for main patron searhc, but I cannot solve sorting there
Comment 50 Katrin Fischer 2022-04-27 12:47:34 UTC
Sorting in the patron search results is a little off:

I have:

Katrin Fischer
Katrina Fischer
Cait Fischer (where Cait is preferred name)

I think the last should be the first entry?

Otherwise all fixes from last testing appear to be ok.
Comment 51 Katrin Fischer 2023-07-01 11:42:00 UTC
Should/can we revive this one?
Comment 52 Suzanne 2024-01-04 23:25:15 UTC
Wow! There has been a lot of work on this! We are interested in being able to have the patron record show "Preferred Name" in quotation marks in the first position followed by first and middle names and then last name. So, for example, it might show as "Sammy" Suzanne Michelle Hodson, with everything being searchable and all showing up on the patron record side bar. My idea would be to let registering patrons fill in the first and middle name field and also the preferred name field and have them show up in that order on Koha, or let libraries choose how they would like the names to show up or whether to have them hidden, if that is possible. Thanks for the great efforts on this!
Comment 53 David Cook 2024-03-13 05:01:21 UTC
(In reply to Katrin Fischer from comment #51)
> Should/can we revive this one?

I still have people asking for this, so it would be great to see it make it.