Bug 14973: Fix edit a suggestion and dup found
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 18 Nov 2019 15:53:41 +0000 (16:53 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 2 Jan 2020 12:36:26 +0000 (12:36 +0000)
commit93a06105a825e9ef585d7acb0b7cad319580dce5
treecd342110845dd61e784cc1ba4c108580d9f6789c
parent52196919f22cb4e72dc61b670ea400f15c4a9cf6
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.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
suggestion/suggestion.pl