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 <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Laura_Escamilla 2026-06-30 13:23:19 +00:00 committed by Pedro Amorim
parent cb534eb7d3
commit 9a875d0202
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,7 @@ use Koha::AuthorisedValues;
use Koha::Acquisition::Currencies; use Koha::Acquisition::Currencies;
use Koha::Libraries; use Koha::Libraries;
use Koha::Patrons; use Koha::Patrons;
use Koha::Suggestion;
use Koha::Suggestions; use Koha::Suggestions;
use Koha::Token; use Koha::Token;
@ -177,6 +178,9 @@ if ( $op =~ /cud-save/ ) {
{ {
push @messages, push @messages,
{ type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle }; { type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle };
$stored_suggestion = Koha::Suggestion->new($suggestion_only);
$template->param( $template->param(
messages => \@messages, messages => \@messages,
need_confirm => 1 need_confirm => 1