Bug 16517 - A server error is raised when creating a new list with an existing name
Summary: A server error is raised when creating a new list with an existing name
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 14544
Blocks: 16519
  Show dependency treegraph
 
Reported: 2016-05-13 19:17 UTC by Jonathan Druart
Modified: 2019-06-27 09:24 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16517: Do not crash when creating a list with an existing name (1.30 KB, patch)
2016-05-13 19:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16517: Do not crash when creating a list with an existing name (1.41 KB, patch)
2016-05-13 21:47 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 16517: Do not crash when creating a list with an existing name (1.42 KB, patch)
2016-05-18 22:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-05-13 19:17:42 UTC
A very bad typo causes a server error when a librarian try to create a list with an existing list's name.
This is caused by bug 14544
Comment 1 Jonathan Druart 2016-05-13 19:20:44 UTC
For my defense it looks like a merge conflict error when rebasing bug 14544, but I plead guilty :)
Comment 2 Jonathan Druart 2016-05-13 19:26:15 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2016-05-13 21:47:18 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2016-05-18 22:09:50 UTC
Created attachment 51604 [details] [review]
[PASSED QA] 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 <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Kyle M Hall 2016-05-23 17:16:38 UTC
Pushed to master for Koha 16.05, thanks Jonathan!
Comment 6 Julian Maurice 2016-05-25 08:58:23 UTC
Patch pushed to 3.22.x, will be in 3.22.7