https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17364
Bug ID: 17364 Summary: branchcode should not be allowed in BorrowerUnwantedField, PatronSelfRegistrationBorrowerUnwantedField Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: bar...@bywatersolutions.com QA Contact: testo...@bugs.koha-community.org CC: gmcha...@gmail.com, kyle.m.h...@gmail.com If branchcode is among the fields in BorrowerUnwantedField, saving the borrower record in members/memberentry.pl will generate an Internal Server Error because there is a foreign key constraint on borrowers.branchcode. To replicate the issue: 1/ Set the syspref BorrowerUnwantedField so that it contains branchcode 2/ Create a patron on members/memberentry.pl 3/ Save the patron, you will get "Internal Server Error". It follows that PatronSelfRegistrationBorrowerUnwantedField should not contain branchcode either -- it's necessary to create a record in the borrowers table, so we shouldn't be able to exclude it. Details for those who like that sort of thing: If you're watching the plack error logs,you'll see something like this: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_salinas`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "INSERT INTO `borrowers` ( `address`, `address2`, `borrowernotes`, `cardnumber`, `categorycode`, `city`, `contactnote`, `country`, `dateenrolled`, `dateexpiry`, `dateofbirth`, `debarred`, `email`, `emailpro`, `fax`, `firstname`, `initials`, `mobile`, `opacnote`, `othernames`, `password`, `phone`, `phonepro`, `privacy`, `sex`, `sort1`, `sort2`, `state`, `surname`, `title`, `userid`, `zipcode`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="1234 MAIN ST", 1="", 2="", 3="TESTYTESTERSON", 4="STAFF", 5="Bradley, CA", 6="", 7="", 8='2016-09-27', 9='2024-12-27', 10=undef, 11=undef, 12="", 13="", 14="", 15="TESTY", 16="", 17="", 18="", 19="", 20='!', 21="555 555 1212", 22="", 23=1, 24="", 25="C", 26="", 27="", 28="TESTERSON", 29="", 30='testy.testerson', 31="93426"] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. DBIx::Class::Storage::DBI::_dbh_execute(): Cannot add or update a child row: a foreign key constraint fails (`koha_salinas`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) at /usr/share/koha/lib/C4/Members.pm line 769 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/