[Bug 44026] New: Bulk cover image upload dies with an error page when no line of the zip works, and the delimiter hint names the wrong character
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 Bug ID: 44026 Summary: Bulk cover image upload dies with an error page when no line of the zip works, and the delimiter hint names the wrong character Initiative type: --- Sponsorship --- status: Product: Koha Version: 26.05 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- In Tools > Upload local cover image (ZIP file), two problems in stable releases: 1. Uploading (a) a file that is not a zip, or (b) a zip whose datalink.txt has no valid line (e.g. "6 cover-6.jpg", no comma) fails with an error page (HTTP 500) instead of showing the UZIPFAIL / DELERR message. The log shows: Can't call method "biblionumber" on an undefined value at tools/upload-cover-image.pl line 256. A bulk upload has no itemnumber, so Koha::Items->find($itemnumber)->biblionumber dies when no line set a biblionumber. 2. The DELERR message says "Please verify that you are using either a single quote or a tab", but the script only accepts a comma or a tab (its own log message says "either a ',' or a 'tab'"). In main, bug 42804 removes this code (it replaces upload-cover-image.pl with the REST API), so these patches are for the stable branches: written against 26.05.x, and they apply cleanly to 25.11.x too. Reproduced on Koha 26.05.02. See also bug 37978, a different 500 on the same page. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 210870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210870&action=edit Bug 44026: Do not die when a bulk cover upload fails Bug 44026: Do not die when a bulk cover upload fails When a zip upload sets an error and no line gave a biblionumber (or the file is not a zip), upload-cover-image.pl called Koha::Items->find(undef)->biblionumber and died, so the librarian saw an error page instead of the error message. Test plan: 1. Tools > Upload local cover image, choose a text file renamed to .zip, choose "ZIP file", Process images: error page (500). 2. Same with a zip whose datalink.txt contains "6 cover.jpg" (no comma): error page. 3. Apply the patch, restart Plack. 4. Repeat 1: "Failed to unzip archive." is shown. 5. Repeat 2: "Unrecognized or missing field delimiter." is shown. 6. Upload a good zip and a single image for a record: both still work. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 --- Comment #2 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 210871 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210871&action=edit Bug 44026: Fix the delimiter hint shown after a bulk cover upload Bug 44026: Fix the delimiter hint shown after a bulk cover upload When datalink.txt/idlink.txt has no valid field delimiter, the upload page says "Please verify that you are using either a single quote or a tab", but upload-cover-image.pl only accepts a comma or a tab (its own log message says "either a ',' or a 'tab'"). Following the hint cannot work. Test plan: 1. Tools > Upload local cover image, choose "ZIP file" and upload a zip whose datalink.txt has a line like "6 cover.jpg" (space, no comma). 2. The message says "either a single quote or a tab". 3. Apply the patch and repeat: it says "either a comma or a tab". 4. Change the line to "6,cover.jpg" and upload again: the image is attached, confirming a comma is the accepted delimiter. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Sponsorship status|--- |Sponsored Comma delimited| |Koha Solutions list of Sponsors| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210870|0 |1 is obsolete| | Attachment #210871|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 211151 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211151&action=edit Bug 44026: Do not die when a bulk cover upload fails When a zip upload sets an error and no line gave a biblionumber (or the file is not a zip), upload-cover-image.pl called Koha::Items->find(undef)->biblionumber and died, so the librarian saw an error page instead of the error message. Test plan: 1. Tools > Upload local cover image, choose a text file renamed to .zip, choose "ZIP file", Process images: error page (500). 2. Same with a zip whose datalink.txt contains "6 cover.jpg" (no comma): error page. 3. Apply the patch, restart Plack. 4. Repeat 1: "Failed to unzip archive." is shown. 5. Repeat 2: "Unrecognized or missing field delimiter." is shown. 6. Upload a good zip and a single image for a record: both still work. Sponsored-by: Koha Solutions Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 211152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211152&action=edit Bug 44026: Fix the delimiter hint shown after a bulk cover upload When datalink.txt/idlink.txt has no valid field delimiter, the upload page says "Please verify that you are using either a single quote or a tab", but upload-cover-image.pl only accepts a comma or a tab (its own log message says "either a ',' or a 'tab'"). Following the hint cannot work. Test plan: 1. Tools > Upload local cover image, choose "ZIP file" and upload a zip whose datalink.txt has a line like "6 cover.jpg" (space, no comma). 2. The message says "either a single quote or a tab". 3. Apply the patch and repeat: it says "either a comma or a tab". 4. Change the line to "6,cover.jpg" and upload again: the image is attached, confirming a comma is the accepted delimiter. Sponsored-by: Koha Solutions Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44026 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed Component|Tools |Cataloging Version|26.05 |Main CC| |david@davidnind.com, | |m.de.rooy@rijksmuseum.nl --- Comment #5 from David Nind <david@davidnind.com> --- Note: Changed version to main, changed component to Cataloguing (from Tools), added release-notes-needed tag. Testing notes (using KTD): 1. Go to Cataloging > Tools > Upload local cover image 2. Step 2 - Message is: Unrecognized or missing field delimiter. Please verify that you are using either a single quote or a tab. 3. After the patches - invalid ZIP file: Failed to unzip archive. Please ensure you are uploading a valid zip file and try again. 4. After the patches - missing deliminator: Unrecognized or missing field delimiter. Please verify that you are using either a comma or a tab. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org