Bugzilla – Attachment 192651 Details for
Bug 41780
Show firstname if preferred_name is empty in 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-emp.patch (text/plain), 3.61 KB, created by
Ayoub Glizi-Vicioso
on 2026-02-06 16:48:47 UTC
(
hide
)
Description:
Bug 41780 - Show firstname if preferred_name is empty
Filename:
MIME Type:
Creator:
Ayoub Glizi-Vicioso
Created:
2026-02-06 16:48:47 UTC
Size:
3.61 KB
patch
obsolete
>From 0a6b4621bd15b84551d10e218b252a7bf6372ef5 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 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. >--- > 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 6ac0d5fd48..e014486728 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