Bugzilla – Attachment 192841 Details for
Bug 41780
Show first name if preferred name is empty on the patron's detail page (moremember.tt)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41780: Show firstname if preferred_name is empty
Bug-41780-Show-firstname-if-preferredname-is-empty.patch (text/plain), 3.79 KB, created by
Ayoub Glizi-Vicioso
on 2026-02-09 19:14:38 UTC
(
hide
)
Description:
Bug 41780: Show firstname if preferred_name is empty
Filename:
MIME Type:
Creator:
Ayoub Glizi-Vicioso
Created:
2026-02-09 19:14:38 UTC
Size:
3.79 KB
patch
obsolete
>From 088c85d164f7a9d0e95a456e97c5738efbd6e182 Mon Sep 17 00:00:00 2001 >From: Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> >Date: Fri, 6 Feb 2026 11:17:41 -0500 >Subject: [PATCH] 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. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc | 7 +++++-- > .../intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- > 2 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >index eae649b832..97b7a9f113 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-title.inc >@@ -76,8 +76,11 @@ > ([%- WRAPPER maybe_span field_name='othernames' -%][%- data.othernames | html -%][%- END -%]) > [%- END -%] > [%- ELSE -%] >- [%- UNLESS no_title %][%- WRAPPER maybe_span field_name='patron_title' -%][%- data.title _ ' ' | html -%][%- END -%][%- END -%] >- [%- WRAPPER maybe_span field_name='preferred_name' -%][%- data.preferred_name | html %][% END -%] >+ [%- IF (data.title) %][%- WRAPPER maybe_span field_name='patron_title' -%][%- data.title _ ' ' | html -%][%- END -%][%- END -%] >+ [%- IF data.preferred_name -%][%- WRAPPER maybe_span field_name='preferred_name' -%][%- data.preferred_name | html %][% END -%][% END -%] >+ [%- IF !(data.preferred_name) -%] >+ [%- WRAPPER maybe_span field_name = 'firstname' -%][%- data.firstname |html %][% END -%] >+ [%- END -%] > [%- IF data.middle_name -%][%- WRAPPER maybe_span field_name='middle_name' -%][% ' ' _ data.middle_name | html -%][%- END -%][%- END -%] > [%- IF data.othernames -%] > [%- WRAPPER maybe_span field_name='othernames' -%][%- ' (' _ data.othernames _ ')' | html -%][%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index cc59617307..0578359a6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -131,7 +131,7 @@ > > <div class="rows"> > <ol> >- [% IF ( patron.preferred_name && patron.firstname ) %] >+ [% IF ( patron.preferred_name && patron.firstname && patron.preferred_name != patron.firstname) %] > <li id="patron_first_name"> > <span class="label patron_first_name">First name: </span> > [% patron.firstname | html %] >-- >2.52.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41780
:
192651
| 192841 |
192842