From 86b2eb9a3a2fc9678a83915d5271099d6b85ca1a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 1 Jun 2026 20:47:00 +0000 Subject: [PATCH] Bug 42740: Fix suggestion status when editing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To test: 1. Make a purchase suggestion. 2. Set the status to something, anything. 3. Edit that suggestion, notice that the "Status:" is set to 'No Status' 4. Now when you save, they actual status is lost. 5. APPLY PATCH, restart_all 6. Try steps 1 - 3. This time at step 3 the suggestion status should be properly set. 7. Save the suggestion, make sure it saves with the correct status. Signed-off-by: Jonathan Druart Signed-off-by: Tomás Cohen Arazi Signed-off-by: Pedro Amorim --- suggestion/suggestion.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 284a47b5a8..500295251d 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -549,11 +549,12 @@ foreach my $r ( @{$sugg_budgets} ) { @{$sugg_budget_loop} = sort { uc( $a->{b_txt} ) cmp uc( $b->{b_txt} ) } @{$sugg_budget_loop}; $template->param( sugg_budgets => $sugg_budget_loop ); -if ( $suggestion_ref->{STATUS} ) { +if ( $stored_suggestion && $stored_suggestion->STATUS ) { $template->param( - "statusselected_" . $suggestion_ref->{STATUS} => 1, - selected_status => $suggestion_ref->{STATUS} - , # We need template var selected_status in the second part of the template where template var suggestion.STATUS is out of scope + "statusselected_" . $stored_suggestion->STATUS => 1, + selected_status => $stored_suggestion->STATUS, + + # We need template var selected_status in the second part of the template where template var suggestion.STATUS is out of scope ); }