Bugzilla – Attachment 145702 Details for
Bug 27424
One should be able to assign an SMTP server as the default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27424: Clarify logic
Bug-27424-Clarify-logic.patch (text/plain), 1.64 KB, created by
Kyle M Hall (khall)
on 2023-01-26 18:45:12 UTC
(
hide
)
Description:
Bug 27424: Clarify logic
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-01-26 18:45:12 UTC
Size:
1.64 KB
patch
obsolete
>From 0241f2afbdcc6819e043617388e261de0edb4edf Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 4 Feb 2022 14:40:15 -0300 >Subject: [PATCH] Bug 27424: Clarify logic > >This patch simplifies how Koha::SMTP::Servers->get_default is written, >to help readability. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/SMTP/Servers.pm | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/Koha/SMTP/Servers.pm b/Koha/SMTP/Servers.pm >index 6925c811b2..d805062e45 100644 >--- a/Koha/SMTP/Servers.pm >+++ b/Koha/SMTP/Servers.pm >@@ -43,21 +43,21 @@ Returns the default I<Koha::SMTP::Server> object. > sub get_default { > my ($self) = @_; > >- my $default; >+ my $default = $self->search({ is_default => 1 }, { rows => 1 })->single; > >- my $smtp_config = C4::Context->config('smtp_server'); >+ unless ($default) { # no database default >+ my $smtp_config = C4::Context->config('smtp_server'); > >- if ( $default = $self->search({ is_default => 1 }, { rows => 1 })->single ) { >+ if ( $smtp_config ) { # use koha-conf.xml >+ $default = Koha::SMTP::Server->new( $smtp_config ); >+ } >+ else { >+ $default = Koha::SMTP::Server->new( $self->default_setting ); >+ } > >- } >- elsif ( $smtp_config ) { >- $default = Koha::SMTP::Server->new( $smtp_config ); >- } >- else { >- $default = Koha::SMTP::Server->new( $self->default_setting ); >+ $default->{_is_system_default} = 1; > } > >- $default->{_is_system_default} = 1; > return $default; > } > >-- >2.30.2
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 27424
:
129673
|
129674
|
129675
|
129814
|
130168
|
130169
|
130170
|
130171
|
130172
|
130300
|
130301
|
130302
|
130303
|
130304
|
145697
|
145698
|
145699
|
145700
|
145701
| 145702 |
145705
|
145723
|
145724
|
145725
|
152192