To recreate: 1 - Create a private list in the opac 2 - Invite 2 patrons to the list 3 - Try to accept from the patron you first shared to 4 - You will get a failure message about expiration of the link It seems we only get the latest invitation when trying to accept: opac/opac-shareshelf.pl line 135: # We could have used ->find with the share id, but we don't want to change # the url sent to the patron my $shared_shelf = Koha::Virtualshelfshares->search( { shelfnumber => $param->{shelfnumber}, }, { order_by => { -desc => 'sharedate' }, limit => 1, } );
Created attachment 74949 [details] [review] Bug 20687 - Check all share keys for a given list This patch gets all the shares for a list and iterates through to find the correct one when accepting from a link To test: 1 - Create a private list in the opac 2 - Invite 2 patrons to the list 3 - Try to accept from the patron you first shared to 4 - You will get a failure message about expiration of the link 5 - Apply patch 6 - Now try to accept the first share 7 - It works! Success!
Just reading the code: should not we search using the invitekey? There is definitely something wrong. Marcel maybe?
(In reply to Jonathan Druart from comment #2) > Just reading the code: should not we search using the invitekey? > There is definitely something wrong. Marcel maybe? I wrote the original code, but the author of bug 14544 made some changes :)
Working on this one now
Nick: Commit title does not start with 'Bug XXXXX: ' - d63a082 !!
Created attachment 75047 [details] [review] Bug 20687: Check all share keys for a given list This patch gets all the shares for a list and iterates through to find the correct one when accepting from a link To test: 1 - Create a private list in the opac 2 - Invite 2 patrons to the list 3 - Try to accept from the patron you first shared to 4 - You will get a failure message about expiration of the link 5 - Apply patch 6 - Now try to accept the first share 7 - It works! Success! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 75048 [details] [review] Bug 20687: (follow-up) Look for invitekey in show_accept and fix error codes We should check the invitekey in show_accept by passing it along in the search call. On the way I fixed some error checking: if the list number is invalid, or the list is public or you are the owner, or if the key is not found, we should set the right error code; the template contains those messages. Test plan: [1] Share a list and accept a correct invitation with another user. [2] Try to accept some invalid proposals: wrong key, wrong list. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested invalid key, wrong list, owner, public list, expiry.
Left only one (known) problem: double accepts (bug 11943). Will try to add something there ;)
Created attachment 75124 [details] [review] Bug 20687: Check all share keys for a given list This patch gets all the shares for a list and iterates through to find the correct one when accepting from a link To test: 1 - Create a private list in the opac 2 - Invite 2 patrons to the list 3 - Try to accept from the patron you first shared to 4 - You will get a failure message about expiration of the link 5 - Apply patch 6 - Now try to accept the first share 7 - It works! Success! Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 75125 [details] [review] Bug 20687: (follow-up) Look for invitekey in show_accept and fix error codes We should check the invitekey in show_accept by passing it along in the search call. On the way I fixed some error checking: if the list number is invalid, or the list is public or you are the owner, or if the key is not found, we should set the right error code; the template contains those messages. Test plan: [1] Share a list and accept a correct invitation with another user. [2] Try to accept some invalid proposals: wrong key, wrong list. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested invalid key, wrong list, owner, public list, expiry. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 18.05, thanks to everybody involved!
Pushed to stable for 17.11.6
Pushed to 17.05.x for v17.05.12