Bug 40699

Summary: Preferred name not displayed for instructors in course reserves in staff interface
Product: Koha Reporter: Michael Adamyk <michael.adamyk>
Component: Course reservesAssignee: Andrew Fuerste-Henry <andrew>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, jonathan.druart, michael.adamyk, raina
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 40958    
Attachments: Bug 40699: Use patron-title for course reserve instructor
Bug 40699: Use patron-title for course reserve instructor
Bug 40699: Correctly format patron everywhere in course reserves

Description Michael Adamyk 2025-08-22 21:08:06 UTC
In the course reserves module, if a patron account used for an instructor on a course has a preferred name different from the patron first name, the course will still display firstname instead of the preferred name.
Comment 1 Andrew Fuerste-Henry 2025-08-25 12:43:12 UTC
https://github.com/Koha-Community/Koha/blob/5832521086b06c2221474791278ebd9b5bdb4049/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt#L117

We should use patron-title.inc here instead of grabbing firstname and surname directly.
Comment 2 Andrew Fuerste-Henry 2025-08-25 14:43:17 UTC
Created attachment 185745 [details] [review]
Bug 40699: Use patron-title for course reserve instructor

To test:
1 - have or make a course reserves course with an instructor
2 - give your instructor a preferred name, confirm the course shows their firstname instead
3 - apply patch, reload page
4 - confirm course now shows their preferred_name instead
5 - edit the patron to remove the preferred name, confirm course shows first name again
Comment 3 Noah Tremblay 2025-09-05 15:33:35 UTC
Created attachment 186233 [details] [review]
Bug 40699: Use patron-title for course reserve instructor

To test:
1 - have or make a course reserves course with an instructor
2 - give your instructor a preferred name, confirm the course shows their firstname instead
3 - apply patch, reload page
4 - confirm course now shows their preferred_name instead
5 - edit the patron to remove the preferred name, confirm course shows first name again

Signed-off-by: noah <noah@inlibro.com>
Comment 4 Jonathan Druart 2025-10-06 12:32:22 UTC
Created attachment 187472 [details] [review]
Bug 40699: Correctly format patron everywhere in course reserves
Comment 5 Jonathan Druart 2025-10-06 12:34:48 UTC
Andrew, I found other places: 
* Create/edit a course
* Course list

Can you test and confirm it is needed as well please? :)
Comment 6 Jonathan Druart 2025-10-06 14:19:42 UTC
Note that I found several other places where they are not displayed correctly. I have fixed them on bug 32176. Please have a look :)
Comment 7 Andrew Fuerste-Henry 2025-10-06 19:29:18 UTC
(In reply to Jonathan Druart from comment #5)
> Andrew, I found other places: 
> * Create/edit a course
> * Course list
> 
> Can you test and confirm it is needed as well please? :)

Those places both look good!
They reminded me to go look at the OPAC, where we show firstname rather then preferred_name in both the course list and the course details.
I'll aim to get back there and add those, but if you beat me to it and assign the bug to yourself, I'll be happy to sign off on it. Thanks!
Comment 8 Jonathan Druart 2025-10-07 07:53:25 UTC
(In reply to Andrew Fuerste-Henry from comment #7)
> (In reply to Jonathan Druart from comment #5)
> > Andrew, I found other places: 
> > * Create/edit a course
> > * Course list
> > 
> > Can you test and confirm it is needed as well please? :)
> 
> Those places both look good!
> They reminded me to go look at the OPAC, where we show firstname rather then
> preferred_name in both the course list and the course details.
> I'll aim to get back there and add those, but if you beat me to it and
> assign the bug to yourself, I'll be happy to sign off on it. Thanks!

I would suggest to do that on a separate bug report, because of
  commit 4dba088549d1add43cfd575ebdd3d21689c4a700
  Bug 15699 - Course reserves instructors should be in form "Surname, Firstname" for sorting purposes

and this code in ./opac-course-reserves.tt
63                                                 ><span class="inst_surname">[% i.surname | html %]</span>[% IF i.firstname %]<span class="instr_separator">, </span><span class="instr_firstname">[% i.firstname     | html %]</span>[% END %]</div
Comment 9 Andrew Fuerste-Henry 2025-10-07 11:38:50 UTC
(In reply to Jonathan Druart from comment #8)
> I would suggest to do that on a separate bug report

Fair enough! setting this back to NSO