Bug 11943: Prevent double accepts in Koha::Virtualshelfshare
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 4 May 2018 07:34:02 +0000 (09:34 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 11 May 2018 13:52:43 +0000 (10:52 -0300)
commit94fd62dac9b8c0bcb3127c4eef91781984c55f7b
tree7a973721ddb099800e7a2f4184e490732940e79d
parentd2ea81e6529768ec4e85afb46cf2e3b7255f9a2e
Bug 11943: Prevent double accepts in Koha::Virtualshelfshare

This 'bug' existed long enough now to finally remove it ;)

We do so by deleting the invitation if the borrower already has a share
on this list. Actually not that hard.

We still need: a unit test and a db revision.

Test plan:
[1] Share a list. Let user B accept.
[2] Without this patch: Share again and let B accept again.
[3] Verify that you have two shares for this list in virtualshelfshares.
[4] With this patch: Share another list, let B accept.
[5] Share this other list again, let B accept again.
[6] Verify that virtualshelfshares does not contain double entries now.
    (Note: This pertains to the second list only.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Virtualshelfshare.pm