After uploading images they disappear after a bit of time (2-4 days). It is not related on cron run or cache clearing. And not sure OCupload is a reason.
But I cann't find a reason. Please help me

Comments

kaztur created an issue. See original summary.

antims’s picture

This problem has been bothering me for a long time. It seems file status has'nt change to permanent sometimes.

nicofnjnu’s picture

Same issue here. Is there anybody willing to help us?

kaztur’s picture

mshdevx’s picture

Hi guys!

We faced with same problem on one of our projects. As this issue still not fixed, we investigated the problem and patched it by self.
Here is explanation what happens:

1. When you upload file in ckeditor initially it saves file as temporary (with $file->status = 0)
2. Then you submit form and ocupload executes ocupload_form_alter().
This is need for adding extra submit handler, which should trigger function ocupload_change_files_status(), but it not happens!
3. Uploaded files with status 0 cron removes after some time.

The reason is because there could be another submit handlers, which executes earlier and trigger $form['redirect'] before ocupload_change_files_status()

mshdevx’s picture

Status: Active » Needs review
StatusFileSize
new688 bytes

Here is a patch, which adds submit handler to actions container if it exist in form.

Red Sky Tom’s picture

As a general observation this happens occasionally to our site when our cache is cleared after someone has uploaded an image, but before they have saved the node. Under these circumstances the file managed status is not updated from 0 to 1.