Bug 20695 - Upload does not show all results when uploading multiple files
Summary: Upload does not show all results when uploading multiple files
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marcel de Rooy
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-02 12:50 UTC by Marcel de Rooy
Modified: 2019-10-14 19:56 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20695: Fix multiple upload result in tools/upload script (1.62 KB, patch)
2018-05-02 12:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20695: Fix multiple upload result in tools/upload script (1.76 KB, patch)
2018-05-09 04:56 UTC, Dilan Johnpullé
Details | Diff | Splinter Review
Bug 20695: Fix multiple upload result in tools/upload script (1.83 KB, patch)
2018-05-10 16:42 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2018-05-02 12:50:03 UTC
In the migration from routine get in Uploader.pm to Koha::UploadedFiles, the multiple upload result got hurt. If you upload 3 files, you get 1 result, but all files have been uploaded.

E.g. 16.11 contains the statement in tools/upload.pl:
my @uploads = Koha::Upload->new($upar)->get($h);
And this worked for multiple uploads.
But master now has:
my $rec = Koha::UploadedFiles->find( $id );
And that works for just one upload.

The fix is simple.
Comment 1 Marcel de Rooy 2018-05-02 12:55:13 UTC
Created attachment 74967 [details] [review]
Bug 20695: Fix multiple upload result in tools/upload script

Instead of calling UploadedFiles->find only once with $id, we should
extract all comma separated id's from the parameter.

Test plan:
[1] Before this patch, upload two files at once in Tools/Upload. After doing
    so, you should see only one result reported. But both files should
    have been uploaded.
[2] With this patch, repeat step 1 and see two upload results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2018-05-02 14:21:56 UTC
Jonathan: If this one could still reach 18.05 ?
Comment 3 Jonathan Druart 2018-05-03 15:14:47 UTC
Yes of course, if PQA before May 11th
Comment 4 Dilan Johnpullé 2018-05-09 04:56:39 UTC
Created attachment 75199 [details] [review]
Bug 20695: Fix multiple upload result in tools/upload script

Instead of calling UploadedFiles->find only once with $id, we should
extract all comma separated id's from the parameter.

Test plan:
[1] Before this patch, upload two files at once in Tools/Upload. After doing
    so, you should see only one result reported. But both files should
    have been uploaded.
[2] With this patch, repeat step 1 and see two upload results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Patch applies and functions as described.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
Comment 5 Marcel de Rooy 2018-05-09 10:58:07 UTC
(In reply to Dilan Johnpullé from comment #4)
> Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Thx Dilan
Comment 6 Katrin Fischer 2018-05-10 16:42:03 UTC
Created attachment 75234 [details] [review]
Bug 20695: Fix multiple upload result in tools/upload script

Instead of calling UploadedFiles->find only once with $id, we should
extract all comma separated id's from the parameter.

Test plan:
[1] Before this patch, upload two files at once in Tools/Upload. After doing
    so, you should see only one result reported. But both files should
    have been uploaded.
[2] With this patch, repeat step 1 and see two upload results.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Patch applies and functions as described.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Jonathan Druart 2018-05-11 14:13:05 UTC
Pushed to master for 18.05, thanks to everybody involved!