https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23217
Nick Clemens <n...@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #91785|0 |1 is obsolete| | --- Comment #10 from Nick Clemens <n...@bywatersolutions.com> --- Created attachment 91808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91808&action=edit Bug 23217: Remove SQL error when batch patron mod and not attribute selected On the batch patron modification tool, if no patron attribute is selected then an UPDATE query will be executed anyway. Indeed the form will send a an empty "patron_attributes" parameter. We need to handle it. Test plan: Go to the patron modification tool Enter a cardnumber Change a field (like city) Do not change anything in the patron's attributes Save => Without this patch a SQL error is generated: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`borrower_attributes`, CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE) [for Statement "INSERT INTO borrower_attributes SET attribute = ?, code = ?, borrowernumber = ?" with ParamValues: 0=undef, 1="", 2="51"] at /home/vagrant/kohaclone/C4/Members/Attributes.pm line 287. => With this patch applied you will not see it You should also test that you can modify patron's attributes ;) Signed-off-by: Hayley Mapley <hayleymap...@catalyst.net.nz> Signed-off-by: Nick Clemens <n...@bywatersolutions.com> -- You are receiving this mail because: 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/