Koha-clms/tools
Jonathan Druart b5b24bdda7 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 <hayleymapley@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0b2a9b5872)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2019-08-09 14:49:36 +02:00
..
csv-profiles
…
quotes
…
access_files.pl Bug 21695: Clean up access files template 2018-12-26 20:47:04 +00:00
ajax-inventory.pl
…
automatic_item_modification_by_age.pl
…
background-job-progress.pl
…
batchMod.pl Bug 22288: Correct item search in batchMod by barcode file 2019-04-10 20:06:21 +00:00
batch_delete_records.pl Bug 12759: (follow-up) Using tabs for diff ways of adding records 2019-02-19 13:52:15 +00:00
batch_record_modification.pl Bug 12759: (follow-up) Using tabs for diff ways of adding records 2019-02-19 13:52:15 +00:00
batch_records_ajax.pl Bug 21579: Make showdiffmarc.pl work for authorities and biblios 2018-10-17 12:29:41 +00:00
cleanborrowers.pl
…
copy-holidays.pl
…
csv-profiles.pl
…
exceptionHolidays.pl
…
export.pl
…
holidays.pl
…
import_borrowers.pl Bug 21993: Display a user-friendly message when the CSRF token is wrong 2019-01-25 20:38:32 +00:00
inventory.pl Bug 23006: Cannot use inventory with barcodes containing special chars 2019-06-10 16:47:13 +02:00
koha-news.pl
…
letter.pl Bug 23278: Reopen last panel upon "Save and continue" in notices 2019-08-06 16:45:26 +02:00
manage-marc-import.pl
…
marc_modification_templates.pl
…
modborrowers.pl Bug 23217: Remove SQL error when batch patron mod and not attribute selected 2019-08-09 14:49:36 +02:00
newHolidays.pl
…
overduerules.pl
…
picture-upload.pl Bug 21993: Display a user-friendly message when the CSRF token is wrong 2019-01-25 20:38:32 +00:00
quotes-upload.pl
…
quotes.pl
…
scheduler.pl
…
showdiffmarc.pl Bug 21579: Make showdiffmarc.pl work for authorities and biblios 2018-10-17 12:29:41 +00:00
stage-marc-import.pl
…
stockrotation.pl
…
tools-home.pl
…
upload-cover-image.pl
…
upload-file.pl
…
upload.pl
…
viewlog.pl Bug 22365: Removing warn when accessing Log Viewer 2019-04-19 14:24:26 +00:00