[Bug 41780] New: Show firstname if preferred_name is empty in moremember.tt
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Bug ID: 41780 Summary: Show firstname if preferred_name is empty in moremember.tt Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: ayoub.glizi-vicioso@inLibro.com Reporter: ayoub.glizi-vicioso@inLibro.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Depends on: 28633 Since bz28633, the patron's firstname is no longer displayed in the staff interface (moremember.tt) if the 'preferred_name' field is NULL or empty. This issue occurs when patrons are imported via external scripts (like Activitek) that do not automatically populate 'preferred_name' with the 'firstname' value. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28633 [Bug 28633] Add a preferred name field to patrons -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #1 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- To reproduce this issue, you will need to: Option 1: 1- Create a patron via the staff interface 2- Set the patron preferred name to null, using : --> UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [specify the patron's borrowernumber that you just created] Option 2: 1-ADD patron directly in BD. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #2 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- To reproduce this issue, you will need to: Option 1: 1- Create a patron via the staff interface 2- Set the patron preferred name to null, using : --> UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [specify the patron's borrowernumber that you just created]; Option 2: 1-ADD patron directly in BD. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #3 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 192651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192651&action=edit Bug 41780 - Show firstname if preferred_name is empty To test: BEFORE APPLYING PATCH: 1- Create a new patron( Patrons > +New patron ), WITHOUT entering any preferred name, via the staff interface. --> Notice that once added, if you edit the patron you just created, the preferred name field will have been automatically filled to match the patron first name. 2- Set your patron's preferred name to NULL through this SQL request: --> UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [borrowernumber located in the URL]; 3- Make sure that the preferred name field of which you set to NULL is empty ( Patron details page > Edit). 4- Go back to the patron's main information page. --> Notice that only the surname shows up. 5- Apply this patch. AFTER APPLYING PATCH: 6- Refresh the page (Ctrl + r and F5). 7- Notice that the first name is now also displayed. 8- Open the 'edit patron' form and you will see that the preferred name field is still empty. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #4 from David Nind <david@davidnind.com> --- Hi Ayoub. This didn't work for me - the first name doesn't display in step 7. I restarted everything after applying the patch, and also cleared the browser cache. In addition, when searching the first name is not shown for the patron I created. Note: running the QA script (qa) has a warning which needs fixing: - Commit title does not start with 'Bug XXXXX: ' David -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #5 from David Cook <dcook@prosentient.com.au> --- I bumped into this same problem for similar reasons, but I think there might be other places that would be a problem too. I think that you're better off just setting preferred_name to firstname if preferred_name is empty like Koha's internal functions do -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #6 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 192841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192841&action=edit Bug 41780: Show firstname if preferred_name is empty To test: BEFORE APPLYING PATCH: 1- Create a new patron(Patrons > +New patron), WITHOUT entering any preferred name, via the staff interface. --> Notice that once added, if you edit the patron you just created, the preferred name field has been automatically filled to match the patron first name. 2- Stay on the patron edit page. 3- Set your patron's preferred name to NULL through this SQL request: --> UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [borrowernumber located in the URL]; 4- Reload the edit_form page. --> Notice that the preferred_name field is now empty. --> Note: do not save the form. 5- Return to the patron's main information page. --> Notice that only the surname is displayed. 6- Apply this patch. AFTER APPLYING PATCH: 7- From the main page go to: Patrons > Search --> Search for the patron whose preferred name was set to NULL. 8- Notice that the firstname is now displayed (Note: reload page and clear the cache if needed). 9- Open the 'Edit patron' form and you will see that the preferred name field is now filled to match the firstname. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #7 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 192842 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192842&action=edit Bug 41780: (follow-up) Update preferred name field if empty -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192651|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #8 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Hello everyone. Thank you for your feedbacks. I have updated the logic so that if the preferred_name is empty (NULL or whitespace), it is automatically synchronized with the patron's firstname. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #9 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #4)
Hi Ayoub.
This didn't work for me - the first name doesn't display in step 7.
I restarted everything after applying the patch, and also cleared the browser cache.
I retested - the first name is still not showing for me on the patron's detail page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Show firstname if |Show first name if |preferred_name is empty in |preferred name is empty on |moremember.tt |the patron's detail page | |(moremember.tt) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192841|0 |1 is obsolete| | --- Comment #10 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 195028 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195028&action=edit Bug 41780: Show firstname if preferred_name is empty To test: BEFORE APPLYING PATCH: 1- Create a new patron(Patrons > +New patron), WITHOUT entering any preferred name, via the staff interface. --> Notice that once added, if you edit the patron you just created, the preferred name field has been automatically filled to match the patron first name. 2- Stay on the patron edit page. 3- Set your patron's preferred name to NULL through this SQL request: --> UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [borrowernumber located in the URL]; 4- Reload the edit_form page. --> Notice that the preferred_name field is now empty. --> Note: do not save the form. 5- Return to the patron's main information page. --> Notice that only the surname is displayed. 6- Apply this patch. AFTER APPLYING PATCH: 7- From the main page go to: Patrons > Search --> Search for the patron whose preferred name was set to NULL. 8- Notice that the firstname is now displayed (Note: reload page and clear the cache if needed). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192842|0 |1 is obsolete| | --- Comment #11 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 195029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195029&action=edit Bug 41780: (follow-up) Update preferred name field if empty -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #12 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 195030 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195030&action=edit Bug 41780: (Follow-up) Ensure firstname is used if preferred name is missing in patron import -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #13 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- (In reply to David Nind from comment #9)
(In reply to David Nind from comment #4)
Hi Ayoub.
This didn't work for me - the first name doesn't display in step 7.
I restarted everything after applying the patch, and also cleared the browser cache.
I retested - the first name is still not showing for me on the patron's detail page.
Hi David, I have updated the patch. What has changed: Instead of relying on the Perl override in Koha/Patron.pm, I have moved the fallback logic directly into the template: koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc. Note: I suspect the previous failure might have been caused by the old Perl logic or the previous version of the templates remaining in memory. Could you please confirm if you are running Plack? If so, a Plack restart might be necessary after applying this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #14 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- I've tested this on my side, and the name now displays correctly even when the preferred name is set to NULL. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am wondering if we actually "want" to fix this. The preferred_name being NULL in the database is a data issue and should not occur. If it does occur, we probably will want to find the source of the issue and fix that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #16 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #15)
I am wondering if we actually "want" to fix this. The preferred_name being NULL in the database is a data issue and should not occur. If it does occur, we probably will want to find the source of the issue and fix that.
Agreed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195028|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195029|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195030|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #17 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 196182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196182&action=edit Bug 41780: Show firstname if preferred_name is empty To test (edited): BEFORE APPLYING PATCH 1- Create a new patron (Patrons > +New patron) without entering any preferred name via the staff interface. 1.1. Note that once added, if you edit the patron you just created, the preferred_name field is empty. 1.2. Verify that only the surname is displayed in patron listings or search results. 2- Set the patron’s preferred_name to NULL directly in the database using SQL: UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [borrowernumber]; 3- Reload the patron edit form page. 3.1. Verify that the preferred_name field is empty. 3.2. Do not save the form. 4- Return to the patron's main information page. 4.1. Verify that only the surname is displayed in the interface. APPLY PATCH 5- Apply the patch that ensures preferred_name is automatically filled with firstname when empty. 6- From the main page, go to Patrons > Search. 6.1. Search for the patron whose preferred_name was previously NULL. 6.2. Verify that the firstname is now displayed in place of the empty preferred_name field. 6.3. Reload the page and clear the cache if necessary to confirm the change is persistent. RUNNING THE SCRIPT 7- Execute the new script that updates the database triggers and existing patrons: perl ./misc/koha_preferred_name_trigger_manager.pl --install 8- Verify that patrons with empty or NULL preferred_name fields now have preferred_name automatically filled with firstname. 8.1. Check the database directly or reload the patron’s edit page. 8.2. Confirm that the firstname is copied into preferred_name where it was empty. Note: If you ever need to remove the triggers created by this script, you can run it with the --drop option: perl ./misc/koha_preferred_name_trigger_manager.pl --drop POST-SCRIPT VERIFICATION 9- Set the preferred_name of a patron back to NULL in the database: UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = [borrowernumber]; 10- Reload the patron edit page. 10.1. Verify that the preferred_name field is still displayed, automatically populated from firstname. 10.2. Ensure that the main patron page shows both surname and firstname correctly. 11- Confirm that the script behavior works consistently for any new INSERT or UPDATE operations where preferred_name is NULL or empty. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #18 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 196183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196183&action=edit Bug 41780: (follow-up) Update preferred name field if empty Patch from commit 8256344 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #19 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 196184 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196184&action=edit Bug 41780: (follow-up) Ensure firstname is used if preferred name is missing in patron import Patch from commit 6f5e330 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #20 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 196185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196185&action=edit Bug 41780: Handle missing preferred_name for patrons in DB Patch from commit 3688508 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #21 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- (In reply to Katrin Fischer from comment #15)
I am wondering if we actually "want" to fix this. The preferred_name being NULL in the database is a data issue and should not occur. If it does occur, we probably will want to find the source of the issue and fix that.
I understand that this is primarily a data issue and that resolving it at the source would be the preferred approach. However, in practice, Koha is often integrated with external scripts maintained by a third party, which may bypass its internal logic responsible for properly populating preferred_name, resulting in NULL or empty values. Correcting these third-party scripts can be complicated, making immediate source fixes challenging. While fixing the source is important, the staff interface must also remain robust. Failing to display a patron’s name due to incomplete data negatively impacts the staff experience. As an intern, I wanted to propose a safe and practical solution: implementing a simple fallback to firstname in the template to make the UI more resilient. I have also added optional database-level safeguards that enforce the same logic as Koha, ensuring consistent data even when external processes bypass Koha’s internal mechanisms. These safeguards can be installed or removed at any time if external scripts are later updated to follow Koha’s conventions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |nick@bywatersolutions.com --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think the problem here is that fixing in one spot, we still will have a lot of others that will break over time. We need to ensure that our APIs do the right thing and that is the real bug. Adding some extra CC for more eyes. If we go the route with fixing the API, we should adjust bug description. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41986 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #23 from David Cook <dcook@prosentient.com.au> --- Ayoub: does bug 41986 provide enough information for you? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #24 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Hi David, Yes, I’ll review bug 41986 more closely and work on proposing a solution aligned with that approach. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196182|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196183|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196184|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #25 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- Created attachment 196958 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196958&action=edit Bug 41780: Show firstname and preferred_name in header; handle empty and matching values Test Plan Preconditions: - Patch applied - Koha UI manages preferred_name automatically, so to modify it manually or set it to empty, use SQL queries in the database Note: - Depending on other information entered for the patron (e.g., title, middle name), the final header may include additional names or prefixes. - This test plan focuses on verifying the behavior of firstname and preferred_name in the header. Test Steps: 1. Create a new patron (Patrons > +New patron) - Enter First name: Alexandra - Fill in all other required information (e.g., surname, card number, etc.) - Leave Preferred name empty Header expected: Alexandra (plus any other title/name that was entered) 2. Modify the preferred_name via SQL and observe the header behavior: a. preferred_name = NULL SQL: UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra (other title/names may appear if entered) b. preferred_name = '' (empty string) SQL: UPDATE borrowers SET preferred_name = '' WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra c. preferred_name = firstname (same as firstname) SQL: UPDATE borrowers SET preferred_name = firstname WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra d. preferred_name ≠ firstname (e.g., Alex) SQL: UPDATE borrowers SET preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; Header expected: Alex | Alexandra (plus other title/names if entered) e. firstname = NULL or empty, preferred_name defined SQL: UPDATE borrowers SET firstname = NULL, preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; OR SQL: UPDATE borrowers SET firstname = '', preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; Header expected: Alex -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #26 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- For this patch, I followed the same approach as bug 41986 to address the immediate issue. I acknowledge that, like 41986, this fix only affects the patron’s header in the staff interface and does not resolve the root problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #27 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- I am providing here an example illustrating the behavior, shown in this screenshot: snipboard.io/rwtDUW.jpg. This example corresponds to test case d (preferred_name ≠ firstname), showing the patron header as Alex | Alexandra (preferred_name | firstname). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #28 from Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> --- (In reply to Ayoub Glizi-Vicioso from comment #27)
I am providing here an example illustrating the behavior, shown in this screenshot: snipboard.io/rwtDUW.jpg. This example corresponds to test case d (preferred_name ≠ firstname), showing the patron header as Alex | Alexandra (preferred_name | firstname).
https://snipboard.io/rwtDUW.jpg -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196185|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196958|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #29 from David Nind <david@davidnind.com> --- Created attachment 197131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197131&action=edit Bug 41780: Handle missing preferred_name for patrons in DB Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #30 from David Nind <david@davidnind.com> --- Created attachment 197132 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197132&action=edit Bug 41780: Show firstname and preferred_name in header; handle empty and matching values Test Plan Preconditions: - Patch applied - Koha UI manages preferred_name automatically, so to modify it manually or set it to empty, use SQL queries in the database Note: - Depending on other information entered for the patron (e.g., title, middle name), the final header may include additional names or prefixes. - This test plan focuses on verifying the behavior of firstname and preferred_name in the header. Test Steps: 1. Create a new patron (Patrons > +New patron) - Enter First name: Alexandra - Fill in all other required information (e.g., surname, card number, etc.) - Leave Preferred name empty Header expected: Alexandra (plus any other title/name that was entered) 2. Modify the preferred_name via SQL and observe the header behavior: a. preferred_name = NULL SQL: UPDATE borrowers SET preferred_name = NULL WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra (other title/names may appear if entered) b. preferred_name = '' (empty string) SQL: UPDATE borrowers SET preferred_name = '' WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra c. preferred_name = firstname (same as firstname) SQL: UPDATE borrowers SET preferred_name = firstname WHERE borrowernumber = <borrowernumber>; Header expected: Alexandra d. preferred_name ≠ firstname (e.g., Alex) SQL: UPDATE borrowers SET preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; Header expected: Alex | Alexandra (plus other title/names if entered) e. firstname = NULL or empty, preferred_name defined SQL: UPDATE borrowers SET firstname = NULL, preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; OR SQL: UPDATE borrowers SET firstname = '', preferred_name = 'Alex' WHERE borrowernumber = <borrowernumber>; Header expected: Alex Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #31 from David Nind <david@davidnind.com> --- I've signed off, as things work as per the test plan. However, I'm really not a fan of the way the names are shown when there is a preferred name and a first name. It is not a pattern we've used elsewhere in Koha, and not something I've seen in other web-based applications. It displays as "Alex | Alexandra Surname (987654321)", where Alexandra is in italics and a smaller text size. Some options (which I'm sure have been debated endlessly on this and other bugs): 1. Preferred name Surname (card number): For example, Alex Surname (987654321) 2. Preferred name (First name) Surname (card number): For example, Alex (Alexandra) Surname (987654321) 2. First name (Preferred name) Surname (card number): For example, Alexandra (Alex) Surname (987654321) My strong preference is for preferred name surname (card number), which is the current way it is shown. (As the default standard patron search returns the correct result if either the preferred name or first name are used.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 --- Comment #32 from David Nind <david@davidnind.com> --- Additional comments: 1. I think the preferred name should be shown in the list of fields under "Contact information" on the patron details page. It currently doesn't. 2. As far as I can tell, no change is required to how the names are shown in the page title, sidebar, breadcrumbs, etc. That is: - If preferred name and no first name, preferred name surname. For example, Alex Surname (987654321). - If preferred name and first name, preferred name surname. For example, Alex Surname (987654321). - If no preferred name or first name, surname. For example, Surname (987654321). - If first name and no preferred name, first name surname, For example, Alexandra Surname (987654321). 3. The bug title seems incorrect to me, may be this was fixed by other bugs. That is, the first name is shown if the preferred name is empty (using the staff interface). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com Assignee|ayoub.glizi-vicioso@inLibro |hammat.wele@inlibro.com |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Chris Mathevet <chris.mathevet@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris.mathevet@inLibro.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org