Bug 13515: DBRev 18.12.00.014
[koha.git] / installer / onboarding.pl
index f8bd84e..1acc420 100755 (executable)
@@ -22,6 +22,7 @@ use C4::Context;
 use C4::InstallAuth;
 use CGI qw ( -utf8 );
 use C4::Output;
+use C4::Members qw(checkcardnumber);
 use Koha::Patrons;
 use Koha::Libraries;
 use Koha::Database;
@@ -172,12 +173,10 @@ if ( $step == 3 ) {
                 branchcode   => scalar $input->param('libraries'),
                 categorycode => scalar $input->param('categorycode_entry'),
                 userid       => scalar $input->param('userid'),
-                password     => scalar $input->param('password'),
-                password2    => scalar $input->param('password2'),
                 privacy      => "default",
                 address      => "",
                 city         => "",
-                flags => 1,    # Will be superlibrarian
+                flags        => 1,    # Will be superlibrarian
             };
 
             my $patron_category =
@@ -186,7 +185,8 @@ if ( $step == 3 ) {
               $patron_category->get_expiry_date( $patron_data->{dateenrolled} );
 
             eval {
-                Koha::Patron->new($patron_data)->store;
+                my $patron = Koha::Patron->new($patron_data)->store;
+                $patron->set_password({ password =>  $firstpassword });
             };
 
             #Error handling checking if the patron was created successfully
@@ -194,6 +194,7 @@ if ( $step == 3 ) {
                 push @messages, { code => 'success_on_insert_patron' };
             }
             else {
+                warn $@;
                 push @messages, { code => 'error_on_insert_patron' };
             }
         }