Bugzilla – Attachment 130172 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.57 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-02-04 17:44:19 UTC
(
hide
)
Description:
Bug 27424: Clarify logic
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-02-04 17:44:19 UTC
Size:
1.57 KB
patch
obsolete
>From a04c35a1e0ab65ca51a7e125c3f3926d91a139ec 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> >--- > 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.32.0
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