From 9a875d02025736995d0c54a196dd05e9f9d70ef0 Mon Sep 17 00:00:00 2001 From: Laura_Escamilla Date: Tue, 30 Jun 2026 13:23:19 +0000 Subject: [PATCH] Bug 42919: Retain suggestion form values when duplicate warning is shown To test: 1. Make a suggestion that will trigger a duplicate warning, in KTD I like "Clothes, clothes, clothes, music, music, music, boys, boys, boys". 2. Fill out some other details, like notes and public notes. 3. The warning says "Click on "Confirm your suggestion" to ignore this message." 4. Notice none of the details are still there. 5. Apply the patch 6. Repeat steps 1-3. Notice that the details remain now after you get the warning message. 7. Submit the form to ensure all details are saved correctly. 8. Sign off and have a lovely day. :D Signed-off-by: Baptiste Wojtkowski Signed-off-by: Lucas Gass Signed-off-by: Pedro Amorim --- suggestion/suggestion.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index e56ffd0cf2..9303d5923b 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -32,6 +32,7 @@ use Koha::AuthorisedValues; use Koha::Acquisition::Currencies; use Koha::Libraries; use Koha::Patrons; +use Koha::Suggestion; use Koha::Suggestions; use Koha::Token; @@ -177,6 +178,9 @@ if ( $op =~ /cud-save/ ) { { push @messages, { type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle }; + + $stored_suggestion = Koha::Suggestion->new($suggestion_only); + $template->param( messages => \@messages, need_confirm => 1