Bug #7438

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

Added by Jan Derriks about 5 years ago. Updated almost 5 years ago.

Bug resolved
Target version:
Start date:
Due date:
% Done:


Estimated time:
SCRUM pts - complexity:


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

Warning: mkdir(): No such file or directory in /var/www/ on line 265 Call Stack: 0.0046 786728 1. {main}() /var/www/ 0.0759 4195856 2. move() /var/www/ 0.0760 4196232 3. copyDirTo() /var/www/ 0.0760 4196928 4. mkdir() /var/www/

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.



Updated by Marko Kastelic about 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/


Updated by Yannick Warnier almost 5 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 It was just a matter of adding the cidReq param to the form action (using the api_get_cidreq() function).

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.


Updated by Yannick Warnier almost 5 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