From b5b5ec67935920da47d7655fd2762c39c718c8d1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 May 2024 12:28:42 +0200 Subject: [PATCH] Bug 36820: Do not generate NEW_SUGGESTION if status has not changed If a suggestion is updated but its status has not been modified we should not send a NEW_SUGGESTION notice. --- Koha/Suggestion.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Suggestion.pm b/Koha/Suggestion.pm index b14c1123ca8..28c99fe60ff 100644 --- a/Koha/Suggestion.pm +++ b/Koha/Suggestion.pm @@ -69,8 +69,9 @@ sub store { my $emailpurchasesuggestions = C4::Context->preference("EmailPurchaseSuggestions"); + my %updated_columns = $self->_result->get_dirty_columns; my $result = $self->SUPER::store(); - if ( $emailpurchasesuggestions && $self->STATUS eq 'ASKED' ) { + if ( $emailpurchasesuggestions && $self->STATUS eq 'ASKED' && exists $updated_columns{STATUS} ) { if ( my $letter = C4::Letters::GetPreparedLetter( -- 2.34.1