Bugzilla – Attachment 26117 Details for
Bug 11917
upload patron image can raise a software error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 11917: upload image - catch error if cardnumber does not exist.
SIGNED-OFF-Bug-11917-upload-image---catch-error-if.patch (text/plain), 1.63 KB, created by
Owen Leonard
on 2014-03-11 15:15:42 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11917: upload image - catch error if cardnumber does not exist.
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-03-11 15:15:42 UTC
Size:
1.63 KB
patch
obsolete
>From fb7dc75fe6808e8f54c1373e8ebcdde2bbef76d1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 10 Mar 2014 14:20:45 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 11917: upload image - catch error if > cardnumber does not exist. >Content-Type: text/plain; charset="utf-8" > >On uploading a patron image, if the given cardnumber does not exist, >a software error is raised > >DBD::mysql::st execute failed: Column 'borrowernumber' cannot be null at >/home/koha/src/C4/Members.pm line 1916. > >Test plan: >SET DEBUG=1 in your apache configuration >go on tools/picture-upload.pl, choose an image and put a cardnumber >which does not exist in DB. >With the patch, you should get a friendly error message. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > tools/picture-upload.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl >index b2aa18a..ab2692a 100755 >--- a/tools/picture-upload.pl >+++ b/tools/picture-upload.pl >@@ -258,7 +258,10 @@ sub handle_file { > $debug and warn "Image is of mimetype $mimetype"; > my $dberror; > if ($mimetype) { >- $dberror = PutPatronImage( $cardnumber, $mimetype, $imgfile ); >+ $dberror = eval { >+ PutPatronImage( $cardnumber, $mimetype, $imgfile ); >+ }; >+ $dberror = $@ if $@; > } > if ( !$dberror && $mimetype ) { # Errors from here on are fatal only to the import of a particular image, so don't bail, just note the error and keep going > $count{count}++; >-- >1.7.9.5
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 11917
:
26005
|
26046
| 26117