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
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
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 Bug 20017: use Modern::Perl in Tools perl scripts 2018-02-05 09:46:45 -03:00
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
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
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