Project

General

Profile

Bug #5677

Dropbox doesn't show received files

Added by Stijn Michels almost 7 years ago. Updated over 3 years ago.

Status:
Needs more info
Priority:
Normal
Assignee:
-
Category:
System
Target version:
Start date:
24/10/2012
Due date:
% Done:

50%

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

Description

After installing nightly builds over time of a week Dropbox doesn't show the received items anymore.
The files are on the server.


Files

Associated revisions

Revision edbe042a (diff)
Added by Julio Montoya almost 7 years ago

Minor query correction see #5677

Revision b72ed3e9 (diff)
Added by Julio Montoya almost 7 years ago

Fixing query in order to view/delete correctly files in the dropbox see #5677

History

#1

Updated by Julio Montoya almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya

testing

#2

Updated by Julio Montoya almost 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Seems to work well for me. Yoselyn, can you try to reproduce the error?

#3

Updated by Yoselyn Castillo almost 7 years ago

testing...

#4

Updated by Yoselyn Castillo almost 7 years ago

It seems to work fine with my installation. All the dropbox files are shown successfully but i am going to test updating an older installation in order to get the same scene... Later i'll give you my feedbacck

#5

Updated by Yoselyn Castillo almost 7 years ago

I confirm the bug, After update a previous older installation, older dropbox files are not shown.

#6

Updated by Yoselyn Castillo almost 7 years ago

  • Assignee changed from Yoselyn Castillo to Julio Montoya

The problem is in this query:
$sql = "SELECT DISTINCT r.file_id, r.cat_id
FROM $post_tbl r INNER JOIN $person_tbl p
ON (r.dest_user_id = p.user_id AND r.c_id = $course_id AND p.c_id = $course_id )
WHERE r.dest_user_id = ".intval($this->userId)." AND r.file_id = p.file_id $condition_session ";

Before updating this was the query and it worked fine:

$sql = "SELECT r.file_id, r.cat_id FROM $post_tbl r, $person_tbl p ".
" WHERE ".
" r.c_id = $course_id AND ".
" p.c_id = $course_id AND ".
" r.dest_user_id = ".intval($this->userId)." AND ".
" r.file_id = p.file_id $condition_session AND ".
" r.c_id = $course_id AND ".
" p.c_id = $course_id ";

But i suppose this is due to other changes, so i didn't change it.

#7

Updated by Stijn Michels almost 7 years ago

This is still the same in nightly build 2012-11-05

#8

Updated by Stijn Michels almost 7 years ago

Maybe this had something to do with: http://support.chamilo.org/issues/5447

#9

Updated by Julio Montoya almost 7 years ago

Yoselyn Castillo wrote:

The problem is in this query:
$sql = "SELECT DISTINCT r.file_id, r.cat_id
FROM $post_tbl r INNER JOIN $person_tbl p
ON (r.dest_user_id = p.user_id AND r.c_id = $course_id AND p.c_id = $course_id )
WHERE r.dest_user_id = ".intval($this->userId)." AND r.file_id = p.file_id $condition_session ";

Before updating this was the query and it worked fine:

$sql = "SELECT r.file_id, r.cat_id FROM $post_tbl r, $person_tbl p ".
" WHERE ".
" r.c_id = $course_id AND ".
" p.c_id = $course_id AND ".
" r.dest_user_id = ".intval($this->userId)." AND ".
" r.file_id = p.file_id $condition_session AND ".
" r.c_id = $course_id AND ".
" p.c_id = $course_id ";

But i suppose this is due to other changes, so i didn't change it.

You should also say in which file/function/class I can found this query.

I suppose you're talking about the Dropbox_Person::Dropbox_Person function file dropbox_class.inc.php

#10

Updated by Julio Montoya almost 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

I sent a little fix in the query can you check if this fix works?

#12

Updated by Stijn Michels almost 7 years ago

Can you send me the whole file for replacement. Now I did a copy past and replace, but it doesn't seem to show the files.

#13

Updated by Julio Montoya almost 7 years ago

Stijn Michels wrote:

Can you send me the whole file for replacement. Now I did a copy past and replace, but it doesn't seem to show the files.

this is the file:

main/dropbox/dropbox_class.inc.php

http://classic.chamilo.googlecode.com/hg-history/44395c81617d29fc51c954d54563b54a9488ab0c/main/dropbox/dropbox_class.inc.php

#14

Updated by Stijn Michels almost 7 years ago

I have tested it with the new file, but I still can't see the files.

#15

Updated by Julio Montoya almost 7 years ago

  • Assignee changed from Yoselyn Castillo to Julio Montoya

Ok I finally got a server with the bug, I will test there and then I will provided a fix that works

#16

Updated by Julio Montoya almost 7 years ago

The bug was included in chamilo 1.9.0. When sending a file 2 records should be registered in the "c_dropbox_person", one for the uploader and the other one for the receiver, so the teacher can delete the file but the user has access to the file

Chamilo 1.9.4 and Chamilo 1.8.8.4:

mysql> select * from c_dropbox_person where file_id = 1094 and c_id = 5;
+------+---------+---------+
| c_id | file_id | user_id |
+------+---------+---------+
|    5 |    1094 |      66 | --teacher
|    5 |    1094 |    1641 | -- student
+------+---------+---------+

In chamilo 1.9.0/1.9.2 this behaviour was removed so the result was something like this:

mysql> select * from c_dropbox_person where file_id = 1094 and c_id = 5;
+------+---------+---------+
| c_id | file_id | user_id |
+------+---------+---------+
|    5 |    1094 |    1641 | -- student
+------+---------+---------+

That's why the teacher can't see the files in chamilo 1.9.4 because that bug was included.

#17

Updated by Julio Montoya almost 7 years ago

File with a recent fix in order to work with the 1 first (Chamilo 1.8.8.4 - 1.9.4) case

http://classic.chamilo.googlecode.com/hg-history/c1b1b2b433c3616ff83f06ea3cd9b86bfd97664e/main/dropbox/dropbox_class.inc.php

#18

Updated by Julio Montoya almost 7 years ago

I'm going to do a script in order to load all "missing files" to the teacher

#19

Updated by Julio Montoya almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)
  • % Done changed from 0 to 50

I uploaded a new file in order to recover the "missing" files please use this in test server not in production

save the file in this folder: main/ dropbox/ and enter to the course with teacher credentials

http://classic.chamilo.googlecode.com/hg-history/3b97ceadf161beb5e866bdc1f0dca56db7203197/main/dropbox/recover_dropbox_files.php

#20

Updated by Yoselyn Castillo almost 7 years ago

Testing...

#21

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Needs testing to Assigned
  • Assignee set to Julio Montoya

Well, I tested with my old version again, I HAVE updated the new code and the dropbox files continue not showing. Have you applied the changes i told you? Is in dropbox_class.inc.php function function Dropbox_Person ().

#22

Updated by Stijn Michels almost 7 years ago

I have uploaded this version of recover_dropbox_files.php, but this file was not present in my nightly build, so I didn't need to replace it.
I think it's not used either.

Stijn

Julio A. Montoya wrote:

I uploaded a new file in order to recover the "missing" files please use this in test server not in production

save the file in this folder: main/ dropbox/ and enter to the course with teacher credentials

http://classic.chamilo.googlecode.com/hg-history/3b97ceadf161beb5e866bdc1f0dca56db7203197/main/dropbox/recover_dropbox_files.php

#23

Updated by Marko Kastelic almost 7 years ago

julio's script is (temporary) support script. Try to do this way:
login, go to the course, enter dropbox:
( here's the sample of the url when inside dropbox tool:
http://stable.chamilo.org/main/dropbox/index.php?cidReq=CURSO2&id_session=0&gidReq=0)

than do the change to the url: replace index.php with recover_dropbox_files.php as
http://stable.chamilo.org/main/dropbox/recover_dropbox_files.php?cidReq=CURSO2&id_session=0&gidReq=0

as i can see, script will try to recover selected files (if any posted by students to the dropbox of the course) (look at the post nr. 16 of this thread). Note: there is no automatics at the moment.

#24

Updated by Julio Montoya almost 7 years ago

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

hello Marko thanks for the explanation that script should recover the missing files as I explained in comment # 16 (needs testing)

Hello Yoselyn, there is was a bug introduced in 1.9.0 as I explain in comment #16, in order to recover those missing files, you need to access to the "recover script" as a teacher as Marko explained in comment 23.

Other possible solution is to create a button that "auto recover all deleted files" only for the the teacher... instead of using that script. The problem is that the this "magic button" will recover all files.

#25

Updated by Marko Kastelic almost 7 years ago

  • Status changed from Needs more info to Assigned
  • Assignee set to Julio Montoya

13.52
fixing previous (replace dropbox_file with dropbox_person)

after a small investigation:
1.8.x
table dropbox_person contains 1 or more records related to the posted file: 1 for poster (and one for each of recepients) ensuring that file is 'erased' when all records are deleted from the table
1.9.x
dropbox_person is functionaly split into 2 tables: dropbox_person that stores records from/for senders and dropbox_post for recepients.

proper migration from 1.8.x to 1.9.x should be as: for every record from dropbox_person that is not related to the sender of the file, create record to the table dropbox_post and remove all records related to receivers from the table dropbox_person.

so, current test script recovers only files for senders ...

edit 14:41
dropbox_person in version 1.9 does not control visibility of the received files any more (as for 1.8.x)

#26

Updated by Stijn Michels almost 7 years ago

The recovery tool does it's job. Also new files are sent and displayed correctly (as far as I tested in the latest build from tonight).
In my case, an automated script would be nice to recover all 'lost' files.

#27

Updated by Yannick Warnier almost 7 years ago

This should be included in the migration script from 1.8 to 1.9 then, and added as a standalone script as well (as the one given here) in the install directory for those (who had 1.8 and are now) upgrading from 1.9.(0|2) to 1.9.4 (which doesn't require a database upgrade normally).

Sorry about that and thank you for the participation on this bug.

#28

Updated by Julio Montoya almost 7 years ago

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

This bug doesn't exists in 1.8.8.4 (as far as I know) that's why there is no need to add a migration process.

There's no DB migration from 1.9.0/1.9.2 to 1.9.4 so it can't be added.

The only solution was to add that file to recover files. I can add a button in the index.php for the teacher, "Recover deleted files" or something like that ...

#29

Updated by Yannick Warnier almost 7 years ago

If the table was not split right the right way, as Marko said, during the migration, then the migration script is wrong and it needs to be fixed (there will still be people migrating from 1.8.8.* to 1.9.4 in the future and we can avoid the problem for them by adding a patch in update-db-1.8.8-1.9.0.inc.php.
Is there really something I still don't understand?

#30

Updated by Yannick Warnier almost 7 years ago

I was posting the comment about the migration with concern for campus.chamilo.org, which I am migrating now, but we'll fix that afterwards with an automated script, because right now I must focus on other possible issues with this migration. I believe we'll get a lot of people pissed on Monday if we don't run that script, though...

#31

Updated by Marko Kastelic almost 7 years ago

Yannick Warnier wrote:

If the table was not split right the right way, as Marko said, during the migration, then the migration script is wrong and it needs to be fixed (there will still be people migrating from 1.8.8.* to 1.9.4 in the future and we can avoid the problem for them by adding a patch in update-db-1.8.8-1.9.0.inc.php.
Is there really something I still don't understand?

current development version of dropbox acts exactly like was acting in 1.8.x versions (last fix about 6 days ago). As Julio said, there is no need for any action when migrating from 1.8.x to 1.9.4. (Checked and double checked). But 'migration' is needed for 1.9.0 and 1.9.2; like merging dropbox_person with dropbox_post for any of the records that does not exist in dropbox_person. Sadly, there is no way to detect, if the recepient's record was removed by recepient him/herself (deleted post) or is just missing due a bug in 1.9.0/2. That's (suppose) why Julio did not provide automatics for recovery
(there is a record for every recepient in dropbox_post table, set when post is done, but it is removed only after post is removed by poster and all the recepients, so the table contains all set of recepients for the entire lifetime of the post).
So a real question is what is worse; supply a button for 'recovery' or returning some of the already deleted posts to inbox(es).

#32

Updated by Julio Montoya almost 7 years ago

Marko did a nice summary, and this is right:

there is no way to detect, if the recepient's record was removed by recepient him/herself (deleted post)

so a automatic fix can't be provided. campus.chamilo.org should have the current version (google code repo) of main/dropbox, in fact we should release a 1.9.4 really soon

#33

Updated by Stijn Michels almost 7 years ago

Why not listing all documents in Dropbox but showing the hidden documents as invisible. Then use the eye icon to 'recover' the documents or to make them visible.

#34

Updated by Yannick Warnier almost 7 years ago

  • Target version changed from 1.9.4 to 1.9.6

I'm postponing this task to 1.9.6. I can't see how to close this task quickly.

#35

Updated by Yannick Warnier over 6 years ago

  • Priority changed from Urgent to Normal
  • Target version changed from 1.9.6 to 2.0
#36

Updated by Yannick Warnier over 3 years ago

  • Target version changed from 2.0 to 3.0

Also available in: Atom PDF