Bug 38276 - allow multifile uploads
allow multifile uploads
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.0
Other Linux
: P5 enhancement (vote)
: UCS 4.0-1-errata
Assigned To: Drees Dormann
Alexander Kläser
:
Depends on:
Blocks: 32331 32888 38335
  Show dependency treegraph
 
Reported: 2015-04-16 09:27 CEST by Drees Dormann
Modified: 2015-04-30 12:32 CEST (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Patch for correct value and set*Attr() handling (3.71 KB, patch)
2015-04-23 14:46 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Drees Dormann univentionstaff 2015-04-16 09:27:44 CEST
+++ This bug was initially created as a clone of Bug #32888 +++

We got the following feedback for Materialverteilung in the forum (http://forum.univention.de/viewtopic.php?f=44&t=1545&p=10240):

"ich denke, dass die Materialverteilung bzw. -einsammlung insgesamt nicht den Ansprüchen genügt:
Es gibt genügend Szenarien, bei denen Schülerleistungen nicht nur aus einer Datei bestehen. Unter Umständen entstehen ganze Verzeichnisstrukturen. Eine Kopie dieser Strukturen in Austauschordner verbietet sich bei Leistungskontrollen von selbst."
Comment 1 Drees Dormann univentionstaff 2015-04-16 13:58:40 CEST
the umc web server needs to be adapted to allow the upload of several files at once
Comment 2 Florian Best univentionstaff 2015-04-16 13:59:41 CEST
Drees, please fix the bug number in the YAML file.
Comment 3 Drees Dormann univentionstaff 2015-04-16 14:33:41 CEST
YAML has been fixed
Comment 4 Alexander Kläser univentionstaff 2015-04-17 20:47:44 CEST
Some fine tuning problems still exist:
* The upload limit is not respected correctly, AFAIS, the limit refers to all multi files together that are sent (as it is only one request).
* When selecting multiFile=true and sending only one file, callback functions should still be called with an array of one element. This way it is much easier for programming and avoids additional checks (multiFile=true → always arrays).
* onUploaded() never receives an array, only the first file being uploaded.
* onChange() is only called with a string. I would expect an array here, as well.
* MultiUploader::get('value') will return duplicated entries (if one file is uploaded multiple times).
* onUploaded() is not called with the MultiUploader (I guess this did not work before, either).
* watch('value', ...) does not work properly as _setValueAttr() needs to call this._set('value', newValue), as well (this did not work before, either).

As discussed, I reverted your changes to the umc-frontend package for now. I also added some test cases for the uploader widget. These will be linked automatically to build/tests when calling make build-dev.

I will adjust the YAML file in a different commit.

r59936 | Bug #38276: revert r59853
r59935 | Bug #38276: revert r59866
r59934 | Bug #38276: revert r59876
r59933 | Bug #38276: added tests for uploader widgets and updated existing tests
Comment 5 Drees Dormann univentionstaff 2015-04-22 14:15:59 CEST
changes have been re-comitted
Comment 6 Drees Dormann univentionstaff 2015-04-22 14:19:51 CEST
r60074

onUploaded() now is recieving an array

fixed duplicated entries in Multiuploader (get and set 'values)
Comment 7 Alexander Kläser univentionstaff 2015-04-22 14:40:06 CEST
Please make sure that every callback handler receives an array if multiFile is set toggled on.
Comment 8 Alexander Kläser univentionstaff 2015-04-23 14:46:44 CEST
Created attachment 6854 [details]
Patch for correct value and set*Attr() handling

Attached you find some adjustments that make the uploader widgets work properly against the latest uploader tests (i.e. with correct value handling (array/string) and notification of observers).
Comment 9 Alexander Kläser univentionstaff 2015-04-23 14:53:43 CEST
I opened Bug 38335 → the check for free disk space during multifile uploads is not done for all uploaded files together. IMHO, this can be adjusted at a later point.
Comment 10 Drees Dormann univentionstaff 2015-04-23 15:21:24 CEST
The issues with the callback handling have been addressed.

Proposed patch has been applied.
Comment 11 Alexander Kläser univentionstaff 2015-04-23 18:17:55 CEST
(In reply to Drees Dormann from comment #10)
> The issues with the callback handling have been addressed.
> 
> Proposed patch has been applied.

Last changes:

r60139 | Yaml Bug #38276
r60137 | *Bug #38276: callbacks will now always recieve an array if mutliFile

(BTW, the commit message of r60137 contains two typos.)

Changes: OK
YAML file: OK

→ VERIFIED.
Comment 12 Janek Walkenhorst univentionstaff 2015-04-30 12:32:00 CEST
<http://errata.univention.de/ucs/4.0/162.html>