Bugzilla – Attachment 74949 Details for
Bug 20687
Multiple invitations to share lists prevents some users from accepting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20687 - Check all share keys for a given list
Bug-20687---Check-all-share-keys-for-a-given-list.patch (text/plain), 2.48 KB, created by
Nick Clemens
on 2018-05-01 13:50:26 UTC
(
hide
)
Description:
Bug 20687 - Check all share keys for a given list
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-05-01 13:50:26 UTC
Size:
2.48 KB
patch
obsolete
>From 569b8711cf405129472175a710a51fe6cb65dd35 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 1 May 2018 13:47:18 +0000 >Subject: [PATCH] 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! >--- > opac/opac-shareshelf.pl | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > >diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl >index e80828a..1bb321c 100755 >--- a/opac/opac-shareshelf.pl >+++ b/opac/opac-shareshelf.pl >@@ -134,29 +134,29 @@ sub show_accept { > > # 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( >+ my $shared_shelves = Koha::Virtualshelfshares->search( > { > shelfnumber => $param->{shelfnumber}, > }, > { > order_by => { -desc => 'sharedate' }, >- limit => 1, > } > ); > >- if ( $shared_shelf ) { >- $shared_shelf = $shared_shelf->next; >+ if ( $shared_shelves ) { > my $key = keytostring( stringtokey( $param->{key}, 0 ), 1 ); >- my $is_accepted = eval { $shared_shelf->accept( $key, $param->{loggedinuser} ) }; >- if ( $is_accepted ) { >- notify_owner($param); >- >- #redirect to view of this shared list >- print $param->{query}->redirect( >- -uri => SHELVES_URL . $param->{shelfnumber}, >- -cookie => $param->{cookie} >- ); >- exit; >+ while ( my $shared_shelf = $shared_shelves->next ) { >+ my $is_accepted = eval { $shared_shelf->accept( $key, $param->{loggedinuser} ) }; >+ if ( $is_accepted ) { >+ notify_owner($param); >+ >+ #redirect to view of this shared list >+ print $param->{query}->redirect( >+ -uri => SHELVES_URL . $param->{shelfnumber}, >+ -cookie => $param->{cookie} >+ ); >+ exit; >+ } > } > $param->{errcode} = 7; #not accepted (key not found or expired) > } else { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20687
:
74949
|
75047
|
75048
|
75124
|
75125