Created attachment 38571 [details] delete patron error msg screen Partners getting a 500 error (screenshot attached) when attempting to delete patrons. It may be that as long as all of the required fields are filled in this error does not occur. But if any fields are missing the error is seen.
If you look in your intranet error logs, you should be able to find the root cause. From the sound of it, I'm guessing that it's a SQL error. Worth checking to see if MySQL is in strict mode. Koha and MySQL in strict mode don't get along very well.
Here's the error as found in intranet-error.log [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] [Mon May 4 08:52:27 2015] deletemem.pl: DBD::mysql::st execute failed: Column 'cardnumber' cannot be null at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm line 1834. [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] Premature end of script headers: deletemem.pl
Hm, is the cardnumber set for the patron they are trying to delete? The cardnumber should never be empty.
(In reply to Barton Chittenden from comment #2) > Here's the error as found in intranet-error.log > > [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] [Mon May 4 08:52:27 > 2015] deletemem.pl: DBD::mysql::st execute failed: Column 'cardnumber' > cannot be null at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm > line 1834. > [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] Premature end of > script headers: deletemem.pl That's an interesting error. When I look at my databases, 'cardnumber' is a nullable column. I'd suggest looking at Koha::Schema::Result::Borrower.pm and seeing if "cardnumber" has "is_nullable" set to 1. I'd also check the actual database to see if it's a nullable column...
(In reply to David Cook from comment #4) > (In reply to Barton Chittenden from comment #2) > > Here's the error as found in intranet-error.log > > > > [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] [Mon May 4 08:52:27 > > 2015] deletemem.pl: DBD::mysql::st execute failed: Column 'cardnumber' > > cannot be null at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm > > line 1834. > > [Mon May 04 08:52:27 2015] [error] [client xx.xx.xx.xx] Premature end of > > script headers: deletemem.pl > > That's an interesting error. When I look at my databases, 'cardnumber' is a > nullable column. I'd suggest looking at Koha::Schema::Result::Borrower.pm > and seeing if "cardnumber" has "is_nullable" set to 1. I'd also check the > actual database to see if it's a nullable column... Yes, borrowers.cardnumber is nullable in the database in question: mysql> describe borrowers; +---------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------------+--------------+------+-----+---------+----------------+ | borrowernumber | int(11) | NO | PRI | NULL | auto_increment | | cardnumber | varchar(16) | YES | UNI | NULL | | and in /usr/share/koha/lib/Koha/Schema/Result/Borrower.pm =head2 cardnumber data_type: 'varchar' is_nullable: 1 size: 16 So... I don't know.
Our library is experiencing this bug, and to add a little more insight, even though the DB 'cardnumber' field is nullable, we've set our BorrowerMandatoryField sys pref to require a value for the 'cardnumber' field. In our case, we allow self-registrations, and during the self-registration process, a card number is not automatically generated -- we manually add that in later once we review each self-registration. So when we come across a self-registered patron during our workflow whose account we need to delete, we get this error since we are trying to delete the account and it does not have one of the required fields. In other words, I don't think this bug involves a SQL error -- perhaps it is needlessly running a check on required fields before deleting the account?
I can't reproduce this one on 3.14.5 or master. Barton: I'd suggest checking /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm line 1834 I use Perl 5.20.1 and that line doesn't seem relevant in my DBIx::Class::Storage::DBI. Which version of DBIx::Class are you using? It looks like we're using version 0.082810.
When I see this it is because the deletedborrowers table has cardnumber set to NOT NULL despite the fact that it should be NULL DEFAULT NULL.
Created attachment 43437 [details] error when deleting patron We also had problem with deleting patrons. `borrowers` . `password` was VARCHAR(60), while `deletedborrowers` . `password` was VARCHAR(30). Setting the latter to 60 resolved this issue in our case (Koha 3.20.01)
(In reply to BUWM from comment #9) > Created attachment 43437 [details] > error when deleting patron > > We also had problem with deleting patrons. > `borrowers` . `password` was VARCHAR(60), while > `deletedborrowers` . `password` was VARCHAR(30). Setting the latter to 60 > resolved this issue in our case (Koha 3.20.01) This will be fixed by bug 15517.
(In reply to Jonathan Druart from comment #10) > (In reply to BUWM from comment #9) > > Created attachment 43437 [details] > > error when deleting patron > > > > We also had problem with deleting patrons. > > `borrowers` . `password` was VARCHAR(60), while > > `deletedborrowers` . `password` was VARCHAR(30). Setting the latter to 60 > > resolved this issue in our case (Koha 3.20.01) > > This will be fixed by bug 15517. *** This bug has been marked as a duplicate of bug 15517 ***