[Bug 7643] New: Can't upload and import zipped file of patron images
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Priority: P5 - low Change sponsored?: --- Bug ID: 7643 CC: gmcharlt@gmail.com Assignee: kyle.m.hall@gmail.com Summary: Can't upload and import zipped file of patron images QA Contact: koha.sekjal@gmail.com Severity: normal Classification: Unclassified OS: All Reporter: oleonard@myacpl.org Hardware: All Status: NEW Version: master Component: Patrons Product: Koha As reported on the mailing list, import of zipped patron images is not working. I created a zip file my patron images and a text file with data looking like this: 0056464,patron1.jpg 0077822,patron2.jpg 0019166,patron3.jpg 0013890,patron4.jpg I tried comma-separated and tab-separated. I have confirmed that the text file is plain text. I've tried using "DATALINK.TXT" and "IDLINK.TXT." Each time I get the same error: Patron Image Failed to Upload Unpacking completed 1 directorie(s) scanned. 1 directorie(s) processed. - Cardnumber: WARNING: This image not imported because the cardnumber and filename is missing. In the log: picture-upload.pl: Missing cardnumber and filename at /kohaclone/tools/picture-upload.pl line 296, <fh00001patron-images.zip> line 112., referer: http://localhost:8888/cgi-bin/koha/tools/picture-upload.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Liz Rea <wizzyrea@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wizzyrea@gmail.com --- Comment #1 from Liz Rea <wizzyrea@gmail.com> --- I confirm this bug - a slight variation, I had a single image, single patron in similar format to Owen's. Mine came back Unpacking completed 4 directorie(s) scanned. 4 directorie(s) processed. Now, I didn't have 4 directories in my zip file, very odd. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Ata ur Rehman <ata.rehman@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ata.rehman@gmail.com --- Comment #2 from Ata ur Rehman <ata.rehman@gmail.com> --- Dear All I'm also getting the same error in Koha 3.6.4 Ata ur Rehman LISolutions -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cnighswonger@foundations.ed | |u Assignee|kyle.m.hall@gmail.com |cnighswonger@foundations.ed | |u -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Katie <kaust@nhusd.k12.ca.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kaust@nhusd.k12.ca.us -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Albert Oller <ago@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ago@bywatersolutions.com --- Comment #3 from Albert Oller <ago@bywatersolutions.com> --- For 3.6 I found that unzip hadn't been installed on a site. Once I installed that I got errors. I installed an earlier version of picture-upload.pl and that resolved the problem. http://git.koha-community.org/gitweb/?p=koha.git;a=blob_plain;f=tools/pictur... I'm seeing a similar problem on 3.8, and am going to test that now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 --- Comment #4 from Albert Oller <ago@bywatersolutions.com> --- Hi, same problem with 3.8 missing unzip fixed with : sudo apt-get install unzip current 3.8 picture-upload.pl gives this error: Patron image failed to upload Unpacking completed 1 directories scanned. 1 directories processed. - Cardnumber: WARNING: This image not imported because the cardnumber and filename is missing. installed the older picture-upload.pl and it now works fine. Here's the diff of the two: (picture-upload.pl.orig = 3.8 version) kohaclone/tools$ diff picture-upload.pl picture-upload.pl.orig 61c61 < picture-upload.p. - Script for handling uploading of both single and bulk patronimages and importing them into the database. ---
picture-upload.pl - Script for handling uploading of both single and bulk patronimages and importing them into the database. 81c81,84 < my $filesuffix = $1 if $uploadfilename =~ m/(\..+)$/i;
my $filesuffix; if ( $uploadfilename =~ m/(\..+)$/i ) { my $filesuffix = $1; }
98c101 < unless (system("unzip $tempfile -d $dirname") == 0) { ---
unless (system("unzip", $tempfile, '-d', $dirname) == 0) {
257,258c260,264 < my $dberror = PutPatronImage($cardnumber,$mimetype, $imgfile) if $mimetype; < 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 ---
my $dberror; if ($mimetype) { $dberror = PutPatronImage( $cardnumber, $mimetype, $imgfile ); } 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
298,299d303 < < =back -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Ivan Brown <I.Brown@littleover.derby.sch.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |I.Brown@littleover.derby.sc | |h.uk --- Comment #5 from Ivan Brown <I.Brown@littleover.derby.sch.uk> --- I think I have managed to fix this. In the new code: my $filesuffix; if ( $uploadfilename =~ m/(\..+)$/i ) { my $filesuffix = $1; } $filesuffix is being declared as local (with my) twice. If the second my is deleted, the upload works. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 --- Comment #6 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to comment #5)
I think I have managed to fix this.
In the new code:
my $filesuffix; if ( $uploadfilename =~ m/(\..+)$/i ) { my $filesuffix = $1; }
$filesuffix is being declared as local (with my) twice.
If the second my is deleted, the upload works.
Good catch indeed! And here is the commit which broke it: http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=b5b71339f3e3dfd6... Maybe you would consider submitting a patch to fix this bug? In return, you'll get your name added to the list of those who make Koha what it is. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 --- Comment #7 from Ivan Brown <I.Brown@littleover.derby.sch.uk> --- Created attachment 12503 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12503&action=edit proposed patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #8 from Chris Nighswonger <cnighswonger@foundations.edu> --- Updating status -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|cnighswonger@foundations.ed |I.Brown@littleover.derby.sc |u |h.uk -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12503|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 12577 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12577&action=edit [SIGNED-OFF] Bug 7643 - Can't upload and import zipped file of patron images Fixed problem with re-declaration of $filesuffix Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |mtj@kohaaloha.com QA Contact|koha.sekjal@gmail.com |mtj@kohaaloha.com --- Comment #10 from Mason James <mtj@kohaaloha.com> --- (In reply to comment #9)
Created attachment 12577 [details] [SIGNED-OFF] Bug 7643 - Can't upload and import zipped file of patron images
Fixed problem with re-declaration of $filesuffix
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
patch looks good, passing QA... thanks for the patch Ivan! :p $ koha-qa.pl -c 1 testing 1 commit(s) (applied to commit 0c75d66) * 7ab41ad Bug 7643 - Can't upload and import zipped file of patron images tools/picture-upload.pl * tools/picture-upload.pl OK -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |paul.poulain@biblibre.com Version|master |rel_3_8 --- Comment #11 from Paul Poulain <paul.poulain@biblibre.com> --- Patch pushed to master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.8.x will be in 3.8.6. Thanks Ivan and welcome to the Koha contributors family! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7643 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org