Browse Source

Bug 27626: Fix self registration if categorycode is hidden and PatronSelfRegistrationVerifyByEmail

If categorycode is selected in
PatronSelfRegistrationBorrowerUnwantedField and
PatronSelfRegistrationVerifyByEmail is turned on, the patron self registration
fails with

   [You must provide a patron's category to validate password's strength
   and length] at /usr/share/perl5/Exception/Class/Base.pm line 88

Test plan:
0. Select categorycode in PatronSelfRegistrationBorrowerUnwantedField
   and turn on PatronSelfRegistrationVerifyByEmail
1. Self register a patron
2. Confirm that it works as expected with this patch applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
master
Jonathan Druart 2 weeks ago
parent
commit
74ae74d5fa
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      opac/opac-memberentry.pl

+ 1
- 1
opac/opac-memberentry.pl View File

@@ -124,6 +124,7 @@ if ( $action eq 'create' ) {
my %borrower = ParseCgiForBorrower($cgi);

%borrower = DelEmptyFields(%borrower);
$borrower{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');

my @empty_mandatory_fields = (CheckMandatoryFields( \%borrower, $action ), CheckMandatoryAttributes( \%borrower, $attributes ) );
my $invalidformfields = CheckForInvalidFields(\%borrower);
@@ -219,7 +220,6 @@ if ( $action eq 'create' ) {
}
);

$borrower{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');
$borrower{password} ||= Koha::AuthUtils::generate_password(Koha::Patron::Categories->find($borrower{categorycode}));
my $consent_dt = delete $borrower{gdpr_proc_consent};
my $patron = Koha::Patron->new( \%borrower )->store;


Loading…
Cancel
Save