https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41780
--- Comment #17 from Ayoub Glizi-Vicioso <[email protected]> --- 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. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
