This is the second time, when it happens. I can't reproduce this bug, can only report about it.

First, the user, who can create and can not delete galleries created one and filled it with images.
Next, after some time (about a day) all files from /drupal/sites/default/files/gallery_assist/UID/gallery_assist_NID folder disappeared. But files in thm, prev, img folders remain still.

I haven't found any connection between user activities and such a bad Drupal behavior...

The good point: now I make backups every day... ^_^

Comments

dzhu’s picture

Update

In the new gallery 24 of 59 files disappeared from the same folder, in six hours after creation. Nobody has edited the gallery...

Any suggestions, how to track the problem?

fw_crocodile’s picture

Did you notice if the status field of these files where set to 0 in the drupal files table?

May be a wrong settings of files's status could have caused the deletion of the files during cron clean up.

dzhu’s picture

Files table in my database is completely free. So, how cron task can delete file, if it is even not in a table?

Module Upload is also turned off at my web-site.

fw_crocodile’s picture

Module Upload isn't concerned. Mine is disabled too.

But you should found all files you use in Gallery Assist on the files table.

The fid field you found on the gallery_assist_item table's record come exactly from the fid relative to the specific file on the files table.

So if you don't have any files on the files table. Something goes wrong.

Cron will certainly delete files with status 0, I don't know if uknown files will be deleted too.

dzhu’s picture

I see.

Is it possible to put files to that table manually or semi-automatically? I will also check this table in database backups, maybe this table was deleted somehow.

And there is some fid values in gallery_assist_item table. But files table is just empty...

fw_crocodile’s picture

You can fill the table manually. But it is really annoying and you have to know exactly what to insert in every field, correct the field in other related tables. Ecc...

If you still have the files, I think it would be a lot quicker to simply reload all the files by the normal way. So you are sure that every field and tables is correctly filled. One wrong field and your files could be deleted, or don't displayed ecc...

dzhu’s picture

I see.

Do you know, which Drupal system call creates rows in the files table? I just want to check other modules on site, may be one of them intervenes into the updating the table. And which hook is used in Gallery assist module to add rows in this table? Or the module modifies the table directly?

fw_crocodile’s picture

Look at http://api.drupal.org/api/group/file/6 to see some function used to manage files.

You should ask jcmc about Gallery Assist, i don't know the module so well.

But i had some similar problems doing reinstall and upgrading of previous version of gallery assist.

You should be more carefull upgarding gallery assist, and use a test site before doing the upgrade on your productions site. Try xampp (lampp on linux).

Gallery Assist is rapidly evolving. Juan is putting a lot of work on it, and I think we have to wait some time to get a finished module.

Until we get the final module, we should be carefull.

dzhu’s picture

You are right.

But I have found something, maybe a bug.

I have activated module Upload, then I have deactivated it. Now new pictures in the galleries appears in the files table! And in each row status is zero!!!

berenddeboer’s picture

Status: Active » Closed (duplicate)
berenddeboer’s picture

Yes, that's the problem. See my patch.

jcmc’s picture

Status: Closed (duplicate) » Fixed

The issue is in the highter versions as 6.x-1.8-beta1 fixed.

Here to explain better the case.

http://api.drupal.org/api/constant/FILE_STATUS_TEMPORARY/6

in includes/file.inc

A files status can be one of two values: temporary or permanent. The status for each file Drupal manages is stored in the {files} tables. If the status is temporary Drupal's file garbage collection will delete the file and remove it from the files table after a set period of time.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.