Project

General

Profile

Bug #6863

Document tool - uploader bug(s)

Added by Marko Kastelic over 7 years ago. Updated about 7 years ago.

Status:
Needs more info
Priority:
Normal
Assignee:
-
Category:
Documents
Target version:
Start date:
11/12/2013
Due date:
24/04/2014
% Done:

60%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Hi,
this one is serious :

file uploaded to the session course documents overwites the existing file with the same name that was uploaded directly to the course (origin). More, the file got overwritten and not flagged as sesion course file (yellow star). Noticed on 1.8.6, applies to the 1.8.8 too (tested on stable). Session uploads must not influent on course content anyway.

i done some further test on stable platform (opening course & opening course(example session):

when using simple upload form:
  • default upload option is set on 'rename if exists' but corresponding radio button is not set (visual)
  • if you chose 'overwrite' from sesion course: file from origin course is overwriten (!!!)

normal(drag&drop) is even worse:
upload from session overwrites files from origin courses and if you try to open the file from the session you got 'Sorry, you are not allowed to access this page ..." (uploader marks any upload as 'erroneous'

session uploader have to ensure that content from the origin stays intact:
when the file with the same name exists in origin course:
drag&drop uploader have to act as : rename if exists (not overwrite)
simple uploader : overwrite have to act as rename if exists

will not flaged this as urgent :)
and, please, about has to be re-checked

Associated revisions

Revision 36131ba8 (diff)
Added by Yoselyn Castillo over 7 years ago

Fixing bug when selecting option uploading files -refs #6863

Revision 17b4ef87 (diff)
Added by Yoselyn Castillo over 7 years ago

Fixing behaviour in documents when rename nothing or overwrite is selected -refs #6863

Revision 47df23b3 (diff)
Added by Yoselyn Castillo over 7 years ago

Setting the deafult option when uploading files -refs #6863

History

#1

Updated by Marko Kastelic over 7 years ago

again ...
and, please, all mentioned above, has to be re-checked. Sorry.

update: i left some files inside Opening Course(Example session) as admin. Just try to open session related documents ...

#2

Updated by Yannick Warnier over 7 years ago

  • Target version set to 1.9.8
#3

Updated by Yoselyn Castillo over 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Yoselyn Castillo
#4

Updated by Yoselyn Castillo over 7 years ago

  • % Done changed from 0 to 50

Fixed default option checked, and action taken following the selected option
Done in:
https://github.com/chamilo/chamilo-lms/pull/208
I continue working in documents uploaded from session

#5

Updated by Yoselyn Castillo over 7 years ago

  • % Done changed from 50 to 70

Done
we upload a file in a session with name "doc.txt"
We enter the direct course
we upload a file in that course with name "doc.txt"
It uploads successfully
If we try to upload a document with the same name inside the direct course, it responds as expected, following the selected option "nothing, ovewrite or rename"

#6

Updated by Yoselyn Castillo over 7 years ago

checking the behaviour in drag and drop

#7

Updated by Yoselyn Castillo over 7 years ago

It works in drag and drop too, please try it with the uploaded files in
https://github.com/chamilo/chamilo-lms/pull/208
and let me your feedback

#8

Updated by Marko Kastelic over 7 years ago

hi Yoselyn,
here are results from quick test:
  • uploaded file cannot be overwritten by the same file in the course (ok)
  • uploaded file cannot be overwritten by the same file in session course (ok)
  • course file connot be overwritten by session course file (yes, but ...???)
  • session course file cannot be overwritten by course file (yes, but ...???)

the last two 'works' if you never try to upload the same file from course and from session course. If you try this, you will get two copies of the same file: session course copy (marked with star) and course copy (from the session course view) -- check the c_document table before uploading; document is 'unique' when c_id is the same and path/title is the same

some thoughts:
session course file must never overwrite course file.
But what about vice versa? Means, that session course file becomes part of the origin course, which is not necessary a bad idea. For the student, there is no difference: file is still accesible; for the origin course teacher on the other hand but, he/she shares another file between sessions containing that origin. Good or bad?
If i extend a bit an idea of converting session couse resources to origin course resource: course is a live 'thing', so does evolve through executing session course too: with new or updated resources, that through time become the part of the original course. Why not we add a tool to the course admin section that 'collects' session specific resources from all sessions containig origin and allow to merge selected with origin?

#9

Updated by Yannick Warnier over 7 years ago

  • Assignee changed from Yoselyn Castillo to Marko Kastelic

Hi Marko,

We already thought about this, but the complexity is into the interface (at the code level, it is only to make a few checks and change the session_id field's value to 0).

We have cases where we have hundreds of sessions on the same course. In this case, showing all resources uploaded by all tutors is a complex issue. Some documents might "show" the same name between several sessions, even if different on disk, and it would be necessary to show from which session such or such document is coming.
This is all made more complex when you add issues about copyright and the fact that the tutor might not necessarily want the main teacher to "copy" his session resource and make it available in other sessions...

There are a lot of things to think about, but you should open a new task for this one if you want to get it implemented, and suggest it for review by as many people as possible before we get it implemented.

#10

Updated by Marko Kastelic over 7 years ago

  • Assignee changed from Marko Kastelic to Yannick Warnier

sorry for delayed answer. i needed to rethink and to collect some third parties
opinions. Looks like copyright is the main issue here, so must agree with your arguments.

for closing this issue, we have to avoid any duplicates. Yes, files with the same names are marked as course or session files, but if the content of the docs is zipped (without a problem, duplicates are stored with the same name) and then localy unzipped, we got problem (two files with the same name on the same part(folder) of the filesystem ... second extracted file try to overwrite the first one extracted.

for now, i'm assigning this issue to you again ...

#11

Updated by Yannick Warnier over 7 years ago

  • Category set to Documents
  • Assignee changed from Yannick Warnier to Julio Montoya
  • % Done changed from 70 to 60

OK, so the only issue remaining is the fact that zipped folders will overwrite files that are in Chamilo already but have the same names as the files in the zip. Assigning to Julio for a fix to that.

#12

Updated by Marko Kastelic over 7 years ago

let me expand this a bit

Yannick Warnier wrote:

OK, so the only issue remaining is the fact that zipped folders will overwrite files that are in Chamilo already but have the same names as the files in the zip. Assigning to Julio for a fix to that.

locally expanded zip suffers from the problem to; since Chamilo 'repository' can contain 2 files with the same name (from merging 2 separate repositories; course+session), zip cannot be expanded without overwriting first expanded file unless performing partial extraction (just selected files) from the zip.
From the zip content you cannot determine the origin of the file (sesssion or course) so nor relevance, without opening extracted file.
This should be fixed on the origin:
a) when zip is created (separate documents: session or course documents should be renamed/suffixed/prefixed
or
b) when document is put into repository (to not allow same file names)

note: when session repository is zipped and than extracted, user should see the homogeneous structure (for the end user, origin of the file (course or session) is of no importance.

reimporting, as Yannick mentioned, is but another problem; should be based on skip/overwrite_existing, and it is always carried out into a single repository (choosen: course or session)

#13

Updated by Julio Montoya about 7 years ago

Marko Kastelic wrote:

let me expand this a bit

Yannick Warnier wrote:

OK, so the only issue remaining is the fact that zipped folders will overwrite files that are in Chamilo already but have the same names as the files in the zip. Assigning to Julio for a fix to that.

locally expanded zip suffers from the problem to; since Chamilo 'repository' can contain 2 files with the same name (from merging 2 separate repositories; course+session), zip cannot be expanded without overwriting first expanded file unless performing partial extraction (just selected files) from the zip.
From the zip content you cannot determine the origin of the file (sesssion or course) so nor relevance, without opening extracted file.
This should be fixed on the origin:
a) when zip is created (separate documents: session or course documents should be renamed/suffixed/prefixed
or
b) when document is put into repository (to not allow same file names)

note: when session repository is zipped and than extracted, user should see the homogeneous structure (for the end user, origin of the file (course or session) is of no importance.

reimporting, as Yannick mentioned, is but another problem; should be based on skip/overwrite_existing, and it is always carried out into a single repository (choosen: course or session)

Option a) is fine for me adding like the document id something like "this_is_a_big_image[ 1 ].jpg"

where [1] is the document_id or maybe just "this_is_a_big_image_1.jpg"

The problem with option b) is that documents with the same name already exist.

#14

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee deleted (Julio Montoya)
#15

Updated by Yannick Warnier about 7 years ago

I cannot hold this one much longer. Marko, Julio, you are welcome to decide on what you think is the best decision here, I don't really mind. I don't think we're touching something that happens too much, but it would be cool to have a clear process and possible warning messages to tell the user what's going on (not necessarily fix it).

If not fix is found before Wednesday 23/04, this will move to 1.10

#16

Updated by Yannick Warnier about 7 years ago

  • Due date set to 24/04/2014
#17

Updated by Marko Kastelic about 7 years ago

Showing allowed actions during file uploads. Origin denotes from where action is taken.

Actions:
O overwrite
R rename
S skip

origin=course

                      O | R | S
--------------------------------
course file         | Y | Y | Y
session course file | N | Y | Y
no file             | Y | / | /

origin=session course

                      O | R | S
--------------------------------
course file         | N | Y | Y
session course file | Y | Y | Y
no file             | Y | / | /

*using 'first upload wins' (should be sufficient since course /with content/ is created first and after binded to the session)
*ensuring no duplicate file names ( important for zip extraction )

so, the only really important rule while uploading is that overwrite is possible only when condition
origin(existing file) == origin(candidate for uploading file) is met

#18

Updated by Julio Montoya about 7 years ago

I'm not sure this is a good fix:

Option a) is fine for me adding like the document id something like "this_is_a_big_image[ 1 ].jpg"

where [1] is the document_id or maybe just "this_is_a_big_image_1.jpg"

File names and folder names should be unique.

#19

Updated by Marko Kastelic about 7 years ago

... (currently) i'm a fan of homogenous repository (from session course point of view). Let me note a couple of reasons:
  • that's what students got when accessing session course,
  • it's easier for teacher to add additional/suplement material/documents and 'bind' it with original document by it's name (eq: course document: englishClassics.doc --> session course document: englishCourse_add1.doc). Sorted by name, all relative documents stays together and can be easily found/detected by teachers and students
  • that way the current zip procedure can stay as is

the only problem is how to restore zip back to the platform; i believe that if you make a zip from session, the only right way is to restore the zip into session. That way, all the files extracted have to become session related files. Extracting should go as : if there is course file with the same name, extracted should be renamed or skipped, if there is session course file with the same name, overwrite, rename, skip can be implemented.

what if one want to extract zip to the course (not session course): (if he/she got the zip - he, he ,...) all the content should become course content with overwrite, rename, skip possibility ...

#20

Updated by Yannick Warnier about 7 years ago

  • Target version changed from 1.9.8 to 2.0

Moving to v10. We clearly won't find a happy ending to this one in a week's time

Also available in: Atom PDF