Bugzilla – Attachment 91808 Details for
Bug 23217
Batch patron modification shows database errors when no Attribute provided
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23217: Remove SQL error when batch patron mod and not attribute selected
Bug-23217-Remove-SQL-error-when-batch-patron-mod-a.patch (text/plain), 1.90 KB, created by
Nick Clemens (kidclamp)
on 2019-07-26 12:55:20 UTC
(
hide
)
Description:
Bug 23217: Remove SQL error when batch patron mod and not attribute selected
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-07-26 12:55:20 UTC
Size:
1.90 KB
patch
obsolete
>From cdbcc20b9ac8d58529f798fc9e2e01bab4aa8e43 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 29 Jun 2019 10:55:17 -0500 >Subject: [PATCH] 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> >--- > tools/modborrowers.pl | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index fb672a631d..014db945a1 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -306,6 +306,7 @@ if ( $op eq 'do' ) { > my $borrower_categorycode = Koha::Patrons->find( $borrowernumber )->categorycode; > my $i=0; > for ( @attributes ) { >+ next unless $_; > my $attribute; > $attribute->{code} = $_; > $attribute->{attribute} = $attr_values[$i]; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23217
:
91131
|
91785
| 91808