Koha/tools
Jonathan Druart 0b2a9b5872
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>
2019-07-26 16:15:17 +01: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
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
batchMod.pl Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01: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-04 09:39:43 +01:00
koha-news.pl Bug 22888: Use DataTables for Koha news table filtering 2019-06-24 14:58:02 +01:00
letter.pl Bug 23278: Reopen last panel upon "Save and continue" in notices 2019-07-19 14:07:36 +01:00
manage-marc-import.pl
marc_modification_templates.pl Bug 13560: Add an 'Add' option for marc modification templates 2018-07-19 17:22:18 +00:00
modborrowers.pl Bug 23217: Remove SQL error when batch patron mod and not attribute selected 2019-07-26 16:15:17 +01: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 Bug 21333: Add ability to add to basket from a new file 2018-09-26 19:05:53 +00:00
stockrotation.pl Bug 11897: Stockrotation 2018-10-09 15:46:05 +00:00
tools-home.pl
upload-cover-image.pl Bug 20564: Don't use system to unzip files 2018-09-19 13:54:26 +00:00
upload-file.pl
upload.pl Bug 19633: Use alphanumeric error codes in upload 2018-08-10 10:10:46 +00:00
viewlog.pl Bug 22365: Removing warn when accessing Log Viewer 2019-04-19 14:24:26 +00:00