If the system preference PatronSelfModificationBorrowerUnwantedField contains branchcode, the branch drop-down isn't populated on the self reigistration page (koha/opac-memberentry.pl). This causes a foreign key constraint violation when the new borrower is added to the borrowers table: [Tue Apr 16 13:56:02.588293 2019] [cgi:error] [pid 12231] [client 10.208.131.107:37284] AH01215: [Tue Apr 16 13:56:02 2019] opac-memberentry.pl: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`load08`.`borrowers`, CONSTRAINT `borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)) [for Statement "INSERT INTO `borrowers` ( `address`, `borrowernumber`, `categorycode`, `city`, `dateenrolled`, `dateexpiry`, `dateofbirth`, `email`, `firstname`, `password`, `privacy`, `state`, `surname`, `userid`, `zipcode`) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" with ParamValues: 0="foo", 1=undef, 2='OBR', 3="foo", 4='2019-04-16T13:56:02', 5='2019-05-16T13:56:02', 6='1970-01-01', 7="foo@example.com", 8="foo", 9='foo', 10=1, 11="CA", 12="foo", 13='foo.foo', 14="99999"] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832., referer: https://foo.bywatersolutions.com/cgi-bin/koha/opac-memberentry.pl To re-create 1) add branchcode to the field list in PatronSelfModificationBorrowerUnwantedField 2) Click 'Register here' link on the front page of the opac 3) Fill out patron data and click 'Submit' => internal server error.
Note that the desire to add branchcode to the PatronSelfModificationBorrowerUnwantedField is common among single branch libraries -- the branches drop-down doesn't serve any purpose there from an end-user perspective.
Hi Barton, why do you suggest? Which library to you pick if there is more than one? A workaround could be to hide it with JS.
Maybe we could make it a hidden form element for libraries with only one branch. For libraries with more than one branch, we could make the library pull down always show and display a note about the 'misconfiguration' on the About page?