Created attachment 118917 [details] Screenshot of error Getting Internal Server Error While importing patrons in .CSV format. This error occurs only when I am trying to import new patrons in CSV format. Server Details: OS: Ubuntu 16.04 LTS KOHA Version: 16.11.14.000 MySQL version: mysql Ver 14.14 Distrib 5.7.33
I don't know if this is the same issue, but I'll take over this bug since there are no other details: Although they're not mentioned on the page as required field, it doesn't seem to be possible to import a CSV of patrons without putting a value in the checkprevcheckout and autorenew_checkouts columns. An error appears in the log if you omit them: [WARN] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'autorenew_checkouts' cannot be null [for Statement "UPDATE `borrowers` SET `autorenew_checkouts` = ?, `checkprevcheckout` = ?, `dateexpiry` = ?, `dateofbirth` = ?, `debarred` = ?, `flags` = ?, `gonenoaddress` = ?, `lang` = ?, `lost` = ?, `password` = ?, `relationship` = ?, `updated_on` = current_timestamp, `userid` = ? WHERE ( `borrowernumber` = ? )" with ParamValues: 0=undef, 1=undef, 2='2024-03-30T00:00:00', 3=undef, 4=undef, 5=undef, 6=undef, 7=undef, 8=undef, 9='!', 10=undef, 11='test.test', 12='65581'] at /kohadevbox/koha/Koha/Object.pm line 169 [WARN] DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'checkprevcheckout' cannot be null [for Statement "UPDATE `borrowers` SET `checkprevcheckout` = ?, `dateexpiry` = ?, `dateofbirth` = ?, `debarred` = ?, `flags` = ?, `gonenoaddress` = ?, `lang` = ?, `lost` = ?, `password` = ?, `relationship` = ?, `updated_on` = current_timestamp, `userid` = ? WHERE ( `borrowernumber` = ? )" with ParamValues: 0=undef, 1='2024-03-30T00:00:00', 2=undef, 3=undef, 4=undef, 5=undef, 6=undef, 7=undef, 8='!', 9=undef, 10='test.test', 11='65581'] at /kohadevbox/koha/Koha/Object.pm line 169
Owen Sir, I am using ../cgi-bin/koha/tools/import_borrowers.pl to import patron in .CSV format. I have upgraded from koha version from 16.05 to 16.11. After upgrading I am facing this error. I am using the same method as I have used earlier. Running KOHA since 2015 and have more than 8000 patron records. CSV Headers I am using: cardnumber,surname,patron_attributes,phone,address,branchcode,categorycode,email,password,userid. I am stuck in between as it is not possible to manually enter the details of 3000-4000 patron details on KOHA. Any help in this regard is highly appreciated.
(In reply to Nitesh Kumar Verma from comment #2) > I have upgraded from koha version from 16.05 to 16.11. I'm sorry but 16.11 is a very old Koha version and isn't supported anymore.
I don't recreate, Owen. I tried to create and update a patron with a csv without and without autorenew_checkouts, checkprevcheckout in the headers (and no value), but they got created/updated correctly.
Looks like the following change is needed @ Koha/Patrons/Import.pm:238 @ sub import_patrons { # Remove warning for int datatype that cannot be null # Argument "" isn't numeric in numeric eq (==) at /usr/share/perl5/DBIx/Class/Row.pm line 1018 for my $field ( - qw( privacy privacy_guarantor_fines privacy_guarantor_checkouts anonymized login_attempts )) + qw( privacy privacy_guarantor_fines privacy_guarantor_checkouts anonymized login_attempts autorenew_checkouts ))
Thanks Owen Leonard & Jonathan Druart for your perusal. I have updated from Mysql to MariaDB and the said problem resolved automatically.