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> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
0018fe8fba
commit
6d54d2419f
1 changed files with 3 additions and 3 deletions
|
@ -44,9 +44,9 @@ sub store {
|
|||
|
||||
$self->_result->result_source->schema->txn_do(
|
||||
sub {
|
||||
Koha::SMTP::Servers->search->update( { is_default => 0 },
|
||||
{ no_triggers => 1 } )
|
||||
if $self->is_default;
|
||||
Koha::SMTP::Servers->search( { id => { '!=' => $self->id } } )
|
||||
->update( { is_default => 0 }, { no_triggers => 1 } )
|
||||
if $self->is_default;
|
||||
|
||||
$self = $self->SUPER::store;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue