Bug 38773 - SMTP server is not showing on the library detail page
Summary: SMTP server is not showing on the library detail page
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-23 11:14 UTC by Marion Durand
Modified: 2025-02-03 13:29 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the library detail page (Administration > Libraries > [view a library]) so that the SMTP server information is now shown (where it exists). Previously, the SMTP server was showing in the list of libraries, but not on the library's individual detail page.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38773: SMTP server is not showing on the library detail page (3.06 KB, patch)
2025-01-30 19:33 UTC, Owen Leonard
Details | Diff | Splinter Review
0001-Bug-38773-SMTP-server-is-not-showing-on-the-library (3.11 KB, application/mbox)
2025-01-30 19:53 UTC, Bosse
Details
Bug 38773: SMTP server is not showing on the library detail (3.11 KB, text/plain)
2025-01-31 15:07 UTC, Bosse
Details
Bug 38773: SMTP server is not showing on the library detail page (3.11 KB, patch)
2025-01-31 15:09 UTC, Bosse
Details | Diff | Splinter Review
Bug 38773: SMTP server is not showing on the library detail page (3.16 KB, patch)
2025-01-31 16:23 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marion Durand 2024-12-23 11:14:12 UTC
When an SMTP server is selected for a library, it is well displayed in the form to modify the library and in the list of all libraries (in column SMTP server) but when viewing a library detail (without editing) the line "SMTP server" is empty.

To reproduce :
1- Create an SMTP server in Koha (it doesn't need to be valid)
	a- Go to Administration > Additional parameters > SMTP servers
	b- Click on "New STP server"
	c- Fill all mandatory fields (it doesn't need to be valid information)
	d- Click on "Submit"

2- Add the created SMTP server to a library
	a- Go to Administration > Basic parameters > Libraries
	b- Choose a library and click on Edit (in column "Actions")
	c- On the line "SMTP server" select the server created
	d- Click on "Submit"

3- Check the display
	a- Go to Administration > Basic parameters > Libraries
	b- Check that the name of the SMTP server you just selected is displayed in the column SMTP server
	c- Click on the name of the library you modified
	d- Check that the line "SMTP server" is empty
	e- Click on "Edit library"
	f- Check that the name of the SMTP server you just selected is still selected
Comment 1 Bosse 2025-01-30 18:54:08 UTC
Hello,

The SMTP server isn't displaying because the template variable smtp_server isn't correctly referencing the associated SMTP server object. Should be an easy fix :)
Comment 2 Owen Leonard 2025-01-30 19:33:29 UTC Comment hidden (obsolete)
Comment 3 Bosse 2025-01-30 19:53:24 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2025-01-31 13:54:14 UTC
Hi Bosse,

can you please re-attach your signed-off patch?

If you are not using git-bz the comand would me something like:

git format-patch origin

If you are using git-bz, which we recommend, you can do this with:

git-bz attach 38773 HEAD^..

the application/mbox format attached cannot be processed by our tools.
Comment 5 Bosse 2025-01-31 15:07:46 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2025-01-31 15:08:52 UTC
(In reply to Bosse from comment #5)
> Created attachment 177393 [details]
> Bug 38773: SMTP server is not showing on the library detail
> 
> Sorry, I ran this command according to the wiki:
> 
> git format-patch -s origin/main

OK, maybe it's in how you attached the patch. We expect a file in .patch format as a result.
Comment 7 Bosse 2025-01-31 15:09:59 UTC
Created attachment 177394 [details] [review]
Bug 38773: SMTP server is not showing on the library detail  page
Comment 8 Katrin Fischer 2025-01-31 15:11:14 UTC
I think we now stepped on each others toes, but result looks good!
Comment 9 Bosse 2025-01-31 15:11:47 UTC
Found the error. I wasn't marking it as a "patch" in bugzilla. Sorry and thanks:)
Comment 10 Katrin Fischer 2025-01-31 15:12:27 UTC
Please don't forge to switch the status to "Signed off" - leaving it to you since the change gets counted for the dashboard :)
Comment 11 Bosse 2025-01-31 15:13:37 UTC
Yes, sorry and thanks for the help!
Comment 12 Lucas Gass (lukeg) 2025-01-31 16:23:47 UTC
Created attachment 177399 [details] [review]
Bug 38773: SMTP server is not showing on the library detail page

This patch fixes and incorrect template variable name, making it
possible to see a library's SMTP server when viewing the details of an
individual library.

Test plan copied from the original bug report:

1. Create an SMTP server in Koha (it doesn't need to be valid)
   a. Go to Administration -> Additional parameters -> SMTP servers
   b. Click "New STP server"
   c. Fill all mandatory fields (it doesn't need to be valid
      information)
   d. Click "Submit"

2. Add the created SMTP server to a library
   a. Go to Administration -> Basic parameters -> Libraries
   b. Choose a library and click on Edit (in column "Actions")
   c. On the line "SMTP server" select the server created
   d. Click "Submit"

3. Check the display
   a. Go to Administration -> Basic parameters -> Libraries
   b. Check that the name of the SMTP server you just selected is
      displayed in the column SMTP server
   c. Click on the name of the library you modified
   d. Check that the line "SMTP server" shows the correct information.

4. Test with different permissions
   a. If the logged-in user has both 'manage_libraries' and
      'manage_smtp_servers' permissions the SMTP server name should be
      liked to the edit form for that server.
   b. If the logged-in user has only 'manage_libraries' permission there
      should be no link.

Signed-off-by: Bo Gustavsson <bosse@gustavsson.one>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 13 Katrin Fischer 2025-01-31 16:39:28 UTC
(In reply to Bosse from comment #11)
> Yes, sorry and thanks for the help!

You are very welcome!
Comment 14 Katrin Fischer 2025-02-03 13:29:23 UTC
Pushed for 25.05!

Well done everyone, thank you!