[Bug 11917] New: upload patron image can raise a software error
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Bug ID: 11917 Summary: upload patron image can raise a software error Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 26005 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26005&action=edit Bug 11917: upload image - catch error if cardnumber does not exist. 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: 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |jonathan.druart@biblibre.co | |m Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- I'm not sure if I'm doing something wrong, but I get the same results before and after the patch. I see a warning box that says "Patron image failed to upload." In the table of results I see "ERROR: Image not imported because the database returned an error. Please refer to the error log for more details." I'm not sure what this patch is supposed to change, but I wonder if we able to make the error message specific? Something about the card number not being found? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26005|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 26046 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26046&action=edit Bug 11917: upload image - catch error if cardnumber does not exist. 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- It appends when DEBUG=0. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26046|0 |1 is obsolete| | --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 26117 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26117&action=edit [SIGNED-OFF] Bug 11917: upload image - catch error if cardnumber does not exist. 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: I appreciate the idea behind the patch, but do not really see the actual benefits of this code. Without DEBUG=1 (as we assume in normal operation), I do not see any difference. I think that the routine in Members, PutPatronImage, should be addressed in this report. It combines the insert into patronimage with the select on cardnumber. It could check cardnumber first. Note that if I see "There is a database error. See the log", I would rather see the error message right away. And the message is passed back by PutPatronImage. Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11917 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |INVALID Assignee|jonathan.druart@biblibre.co |gmcharlt@gmail.com |m | --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to M. de Rooy from comment #6) I opened this bug qaing another one. I didn't know that the issue only appeared for DEBUG=1. I mark it as invalid, feel free to reopen it if you think it is useful. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org