Bug 34622

Summary: SMTP server edit page unsets is_default if editing default server
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: System AdministrationAssignee: Pedro Amorim <pedro.amorim>
Status: RESOLVED FIXED QA Contact: Kyle M Hall <kyle>
Severity: major    
Priority: P5 - low CC: dcook, fridolin.somers, gmcharlt, katrin.fischer, kyle, martin.renvoize, matt.blenkinsop, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34616
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34205
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04
Bug Depends on: 27424    
Bug Blocks:    
Attachments: Bug 34622: Fix store default query
Bug 34622: Fix store default query
Bug 34622: Fix store default query

Description Pedro Amorim 2023-08-25 16:23:35 UTC
To reproduce:
1) Create a new SMTP Server (tick "Default server" checkbox). Save.
2) Now edit that same SMTP Server, don't change anything. Save.
3) Notice how it no longer is default, from the list or by editing again, or by querying SELECT is_default from smtp_servers -> returns is_default:0
Comment 1 Pedro Amorim 2023-08-25 16:27:47 UTC
Created attachment 154837 [details] [review]
Bug 34622: Fix store default query

Exclude self smtp server from all the servers being updated to not default if self is_default
Comment 2 Emily-Rose Francoeur 2023-09-12 15:58:45 UTC
Created attachment 155561 [details] [review]
Bug 34622: Fix store default query

Exclude self smtp server from all the servers being updated to not default if self is_default

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>
Comment 3 Kyle M Hall 2023-09-18 18:46:06 UTC
Created attachment 155858 [details] [review]
Bug 34622: Fix store default query

Exclude self smtp server from all the servers being updated to not default if self is_default

Signed-off-by: Émily-Rose Francoeur <emily-rose.francoeur@inLibro.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Tomás Cohen Arazi 2023-09-19 19:35:44 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-09-21 06:10:23 UTC
Pushed to 23.05.x for 23.05.04
Comment 6 Matt Blenkinsop 2023-10-12 16:05:55 UTC
Dependency missing from 22.11.x - not backporting