Lines 228-233
elsif ( $action eq 'update' ) {
Link Here
|
228 |
}); |
228 |
}); |
229 |
|
229 |
|
230 |
my %borrower = ParseCgiForBorrower($cgi); |
230 |
my %borrower = ParseCgiForBorrower($cgi); |
|
|
231 |
$borrower{borrowernumber} = $borrowernumber; |
231 |
|
232 |
|
232 |
my %borrower_changes = DelEmptyFields(%borrower); |
233 |
my %borrower_changes = DelEmptyFields(%borrower); |
233 |
my @empty_mandatory_fields = |
234 |
my @empty_mandatory_fields = |
Lines 392-398
sub CheckForInvalidFields {
Link Here
|
392 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
393 |
unless ( Email::Valid->address($borrower->{'email'}) ) { |
393 |
push(@invalidFields, "email"); |
394 |
push(@invalidFields, "email"); |
394 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
395 |
} elsif ( C4::Context->preference("PatronSelfRegistrationEmailMustBeUnique") ) { |
395 |
my $patrons_with_same_email = Koha::Patrons->search( { email => $borrower->{email} })->count; |
396 |
my $patrons_with_same_email = Koha::Patrons->search( |
|
|
397 |
{ |
398 |
email => $borrower->{email}, |
399 |
( |
400 |
exists $borrower->{borrowernumber} |
401 |
? ( borrowernumber => |
402 |
{ '!=' => $borrower->{borrowernumber} } ) |
403 |
: () |
404 |
) |
405 |
} |
406 |
)->count; |
396 |
if ( $patrons_with_same_email ) { |
407 |
if ( $patrons_with_same_email ) { |
397 |
push @invalidFields, "duplicate_email"; |
408 |
push @invalidFields, "duplicate_email"; |
398 |
} |
409 |
} |
399 |
- |
|
|