Hi,

I have some issues with Link To Us (Link To Us 6.x-1.x-dev (2008-Aug-07)) on d 6.3:

1) I can't make image appear on the partner website.

2) Images disappear on the Share Page, from time to time.

Any idea about what is wrong ?

Thank you

Comments

Gman’s picture

I haven't been able to reproduce this issue. Are you able to save other images to your site. It sounds as though the images aren't being saved correctly, either from wrong permissions on the server, or on incorrect tmp directory.

Can you provide more information, or provide a link if it is happening on a live site. Thank you.

Arricc’s picture

Priority: Normal » Critical

I'm also seeing this...

I'll load up a bunch of images, and they'll display no problem in the link_to page. Then the next day they're gone!

The files were there, now they're not.

I've had to chattr +i the files to ensure they don't get deleted cause its doing my head in.

I've gone through my apahce logs and can't see any evidence of a call to any of the link_to pages - just success reponses on the images then suddenly 404s... I'm thinking it may be something in the cron task thats deleting the files - maybe as part of a filesystem tidy?

effortlessfix’s picture

***********************************QUOTE**************************************
I'm also seeing this...

I'll load up a bunch of images, and they'll display no problem in the link_to page. Then the next day they're gone!

The files were there, now they're not.
*******************************************************************************
My new install is having this problem as well.
Is there anyway to check the TEMP dir
Or even create a new TEMP dir?
I've noticed other problems running PHP 5 and drupal.
I'm thinking this is a bug in a module some where, it might not even be in the module your using.
Also, what are the chances that dropped packets from a FTP upload could cause this problem?
I having found a way to check files in drupal but it should be on the project list for sure.
I really think drupal should move away from raw file uploads.

Gman’s picture

My first thought was that somehow they were serving from a TEMP directory, and then they were erased during a cron job, or other file clean up.

Could either of you tell me what file names are listed under the image on the settings page, /admin/settings/link_to_us/images? I have a listing like 'files/link_banners/banner.gif'.

Does it list you delete files on this page as well? Or are they removed from here as well.

Currently I am unable to reproduce this issue even after switching to the 'Private Download' method under the file settings (admin/settings/file-system).

-Greg

Renirtor’s picture

Hi,
I have:
'sites/default/files/link_banners/banner.gif'

and the download is NOT set to private

HS’s picture

same issue applies to me. All images uploaded are gone the following day.

HS’s picture

Category: support » bug

Banners that were located sites/default/files/link_banners are all automatically deleted.

Arricc’s picture

I'm currently hacking together a module for myself and discovered the "file_set_status()" API call.
http://api.drupal.org/api/function/file_set_status/6

This module uses file_save_upload but the docs for that function state

The file will be added to the files table as a temporary file. Temporary files are periodically cleaned. To make the file permanent file call file_set_status() to change its status.

Thus, I suspect the fis is simply changing the link_to_us_images_form_validate() function in link_to_us.module:

      if ($file = file_save_upload('upload', $validators, $dir)) {
        if (image_get_info($file->filepath)) {
          file_set_status($file, FILE_STATUS_PERMANENT);
          drupal_set_message(t('New image saved.'));
        }
        else {
          file_delete($file->filepath);
          drupal_set_message('Uploaded file does not appear to be a valid image file. Please try again.');
        }
      }
Arricc’s picture

Status: Active » Needs review
HS’s picture

wait..what's going on? Sorry i'm a newb.. all that sounded greek. I kinda get the gist of things but don't know what to do to rectify it.

Arricc’s picture

Status: Needs review » Reviewed & tested by the community

Have confirmed that the addition of

          file_set_status($file, FILE_STATUS_PERMANENT);

Fixed the issue.

Noira’s picture

Could you please post more detailed instructions on how to implement the patch into the module? I don´t know PHP syntax.

Gman’s picture

Status: Reviewed & tested by the community » Fixed

Code added. Thank you very much Arricc. That was an annoying issue that you solved. Fix will be in the next nightly build of the project. I will release an official D6 release soon.

Status: Fixed » Closed (fixed)

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