From 7dfc64022b8be63a10cb4c3f802d45a0b0f99973 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 May 2016 20:21:12 +0100 Subject: [PATCH] Bug 16517: Do not crash when creating a list with an existing name A typo has been made during a merge conflict when rebasing bug 16517. it should be eval { Koha::Object->new->store; }; instead of eval { Koha::Object->new; }->store; Test plan: From the result list (intranet side), check some entries and add them to a new list Use an existing list's name => Without this patch you will get a server error (exception 'Duplicate shelf object' raised by Koha::Virtualshelf->new->store) => With this patch you must get a friendly error message Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- virtualshelves/addbybiblionumber.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index 790904fefa..71270b7439 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -132,8 +132,8 @@ sub HandleNewVirtualShelf { sortfield => $sortfield, owner => $loggedinuser, } - ); - }->store; + )->store; + }; if ( $@ or not $shelf ) { $authorized = 0; $errcode = 1; -- 2.39.5