@@ -, +, @@
email
---
.../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 ++
opac/opac-shelves.pl | 11 ++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -156,6 +156,8 @@
The item has not been added to the list. Please check it's not already in the list.
[% CASE 'error_on_remove_share' %]
The share has not been removed.
+ [% CASE 'no_email_found' %]
+ No email found for the patrons that accepted the share
[% CASE 'success_on_update' %]
List updated.
[% CASE 'success_on_insert' %]
--- a/opac/opac-shelves.pl
+++ a/opac/opac-shelves.pl
@@ -272,10 +272,15 @@ if ( $op eq 'add_form' ) {
my $patrons = [];
my $shares = $shelf->get_shares->search({ borrowernumber => { '!=' => undef } });
while( my $share = $shares->next ) {
- push @$patrons, { email => $share->sharee->notice_email_address, borrowernumber => $share->get_column('borrowernumber') };
+ my $email = $share->sharee->notice_email_address;
+ push @$patrons, { email => $email, borrowernumber => $share->get_column('borrowernumber') } if $email;
+ }
+ if( @$patrons ) {
+ $template->param( shared_users => $patrons );
+ $op = 'transfer';
+ } else {
+ push @messages, { type => 'error', code => 'no_email_found' };
}
- $template->param( shared_users => $patrons );
- $op = 'transfer';
} elsif( !Koha::Patrons->find($new_owner) ) {
push @messages, { type => 'error', code => 'new_owner_not_found' };
} elsif( !$shelf->get_shares->search({ borrowernumber => $new_owner })->count ) {
--