Bug 38998 - Cannot edit default SMTP server config when not using DB
Summary: Cannot edit default SMTP server config when not using DB
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: David Cook
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-30 05:15 UTC by David Cook
Modified: 2025-01-31 14:58 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38998: Only show Edit link for DB default SMTP server (2.10 KB, patch)
2025-01-30 05:42 UTC, David Cook
Details | Diff | Splinter Review
Bug 38998: Only show Edit link for DB default SMTP server (2.19 KB, patch)
2025-01-30 07:54 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 38998: Only show Edit link for DB default SMTP server (2.29 KB, patch)
2025-01-31 09:32 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2025-01-30 05:15:43 UTC
If you click "Edit" on /cgi-bin/koha/admin/smtp_servers.pl you're taken to a form update that will never complete.

You'll get an "error_on_edit" message immediately on the page as you're taken to this page: "/cgi-bin/koha/admin/smtp_servers.pl?op=edit_form&smtp_server_id="

--

The work around is to just create a new default SMTP server, but the current Koha setup has a bad UX
Comment 1 David Cook 2025-01-30 05:42:16 UTC
Created attachment 177333 [details] [review]
Bug 38998: Only show Edit link for DB default SMTP server

This change only shows the "Edit" on the smtp_servers.pl page
for the "Current default configuratio" if the default
configuration can be edited. That is, don't show it when
config comes from the code, and do show it when the config
comes from the database.

Test plan:
0. Apply the patch
1. Go to /cgi-bin/koha/admin/smtp_servers.pl
2. Ensure you delete any SMTP servers you've defined
3. Note that there is no "Edit" button at the bottom of
"Current default configuration"
4. Click "New SMTP server" and create a new default server
5. Go to /cgi-bin/koha/admin/smtp_servers.pl
6. Notice how now there is an "Edit" link at the bottom of
"Current default configuration"
Comment 2 Magnus Enger 2025-01-30 07:54:30 UTC
Created attachment 177335 [details] [review]
Bug 38998: Only show Edit link for DB default SMTP server

This change only shows the "Edit" on the smtp_servers.pl page
for the "Current default configuratio" if the default
configuration can be edited. That is, don't show it when
config comes from the code, and do show it when the config
comes from the database.

Test plan:
0. Apply the patch
1. Go to /cgi-bin/koha/admin/smtp_servers.pl
2. Ensure you delete any SMTP servers you've defined
3. Note that there is no "Edit" button at the bottom of
"Current default configuration"
4. Click "New SMTP server" and create a new default server
5. Go to /cgi-bin/koha/admin/smtp_servers.pl
6. Notice how now there is an "Edit" link at the bottom of
"Current default configuration"

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised.
Comment 3 Marcel de Rooy 2025-01-31 09:32:24 UTC
Created attachment 177374 [details] [review]
Bug 38998: Only show Edit link for DB default SMTP server

This change only shows the "Edit" on the smtp_servers.pl page
for the "Current default configuratio" if the default
configuration can be edited. That is, don't show it when
config comes from the code, and do show it when the config
comes from the database.

Test plan:
0. Apply the patch
1. Go to /cgi-bin/koha/admin/smtp_servers.pl
2. Ensure you delete any SMTP servers you've defined
3. Note that there is no "Edit" button at the bottom of
"Current default configuration"
4. Click "New SMTP server" and create a new default server
5. Go to /cgi-bin/koha/admin/smtp_servers.pl
6. Notice how now there is an "Edit" link at the bottom of
"Current default configuration"

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan, works as advertised.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Katrin Fischer 2025-01-31 14:40:54 UTC
What means "... when not using DB" in the bug description?
Comment 5 Katrin Fischer 2025-01-31 14:58:17 UTC
Pushed for 25.05!

Well done everyone, thank you!