From 8c2cf9c3b081ccb67a626f2821102c7aeb173709 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Nov 2019 16:53:41 +0100 Subject: [PATCH] Bug 14973: Fix edit a suggestion and dup found The find duplicate call must only be done when the suggestion is new. It does not make sense to search for a duplicate when the suggestion already exists. This patch also fixes a side-effect: - Create a suggestion using an existing biblio title - Ignore the warning and save - Edit again and save => BOOM on date Template process failed: undef error - The given date (18/11/2019) does not match the date format (iso) at /kohadevbox/koha/Koha/DateUtils.pm line 168 The dates are not processed and so badly formatted when sent to the template. --- suggestion/suggestion.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 60dc7ffdf0..3bf52ab6f3 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -133,7 +133,7 @@ if ( $op =~ /save/i ) { itemtype => $suggestion_only->{itemtype}, }); - if ( ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) && !$save_confirmed ) { + if ( !$suggestion_only->{suggestionid} && ( my ($duplicatebiblionumber, $duplicatetitle) = FindDuplicate($biblio) ) && !$save_confirmed ) { push @messages, { type => 'error', code => 'biblio_exists', id => $duplicatebiblionumber, title => $duplicatetitle }; $template->param( messages => \@messages, -- 2.11.0