Project

General

Profile

Bug #7438

Documents and folders get lost when moving docs/folders with multiple tabs in browser open.

Added by Jan Derriks almost 5 years ago. Updated over 4 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
Documents
Target version:
Start date:
04/12/2014
Due date:
% Done:

100%

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

Description

This is a tricky one. I just reproduced a scenario on stable.chamilo.org and received this error:

Warning: mkdir(): No such file or directory in /var/www/stable.chamilo.org/www/main/inc/lib/fileManage.lib.php on line 265 Call Stack: 0.0046 786728 1. {main}() /var/www/stable.chamilo.org/www/main/document/document.php:0 0.0759 4195856 2. move() /var/www/stable.chamilo.org/www/main/document/document.php:1042 0.0760 4196232 3. copyDirTo() /var/www/stable.chamilo.org/www/main/inc/lib/fileManage.lib.php:240 0.0760 4196928 4. mkdir() /var/www/stable.chamilo.org/www/main/inc/lib/fileManage.lib.php:265

The problem we found on our chamilo site was that sometimes a complete set of folders in the document tool of a course disappeared.
Looking in the filesystem however, the files were still in the original place.
Searching the documents database table with phpmyadmin showed that the missing file paths had been renamed in the database documents table.
The paths were changed into some path that belonged to another course.

It took months before I found the problem: some teachers have many browser tabs witch Chamilo courses open. And they "multitask" between them.
Open course1 documents in one tab, click on "move" to move a folder to another folder, choose that folder but don't click MOVE yet.
Then goto another tab, another course2, and open the document tool there.
Then go back to the first tab with course1 and click "MOVE".

What happens then is that Chamilo thinks you are in course 2 and tries to move the files from course1 and that fails.
Session data don't "see" the tab changes.

I am curious if anyone has had this problem before and if you can reproduce it.

History

#1

Updated by Marko Kastelic almost 5 years ago

i remember a discussion about like-this subject years ago (maybe even DOkeos days), that file manipulations (creation, moving, ...) of the files have to be done transactional way because of two repo's that must be manipulated; file system (files) and database tables(meta); both 'changes' must be successfull or neiher one. If i remember right, the problem was oposite: records were changed, but files were not moved.

... and yes, the problem as you described is there andd more,; i just try to move file from course documents root to documents subfolder of the same course; files were moved and are there, and can be accessed with browser by changing url (pointing to the new location), but links to the files remains in the root repository; tested on 1.9.6/1.9.8/stable.chamilo.org

#2

Updated by Yannick Warnier over 4 years ago

  • Status changed from New to Needs testing
  • % Done changed from 0 to 90

This should be fixed in 1.10.0 (can be tested on https://unstable.chamilo.org). It was just a matter of adding the cidReq param to the form action (using the api_get_cidreq() function).

https://github.com/chamilo/chamilo-lms/commit/c7d0528744880bce35af59dc153a298246b2c4ef

This should be possible to transpose very easily to 1.9.x if needed.

I will close this task in 5 days or more if no feedback is provided.

#3

Updated by Yannick Warnier over 4 years ago

  • Status changed from Needs testing to Bug resolved
  • Assignee set to Yannick Warnier
  • % Done changed from 90 to 100

Closing (no feedback). Thanks for the report!

Also available in: Atom PDF