Some time after creating a subtheme the banner image files have been deleted from the "banners" directory (note: the thumbnail image files still exist).

I can't seem to connect this to an action. Initially, the default images were deleted. I added some new images, and over the course of some time they were deleted as well. Perhaps it's related to a cron job? It doesn't seem to be related to adding or deleting images through the provided interface. I can't seem to find anyone else that has this problem.

The only modules I have installed are IMCE and CKEditor.

This is in multi-site configuration.

The directories "files" and "banner" are user and group owned by the webserver (www-data) and have 775 permissions.

Comments

ishadakota’s picture

Category: bug » support
Lioz’s picture

Category: support » bug
Status: Active » Needs work

Hi Isha, I noticed this bug too (if you disable cron the images won't disappear), probably we will fix it in the next release.

mavimo’s picture

Assigned: Unassigned » mavimo
sacchini’s picture

I found that image deletion has occured by clicking on banner image, even by anonymous user.
Deleting URL in every banner image in theme configuration has solved the issue (it was set to FRONT by default.
HTH

dailypress’s picture

yes, I had the same issue. I just uploaded the images again.

Sixtus78’s picture

Deleting URL in every banner image in theme configuration has not solved the issue on my system. Uploaded several times by now. Only thumbnails remain in the folder.

vittala’s picture

I am also having this issue. The banners are there then over night they get deleted. I am assuming it's do to the cron job. Is there a a way to fix this other than turning off the cron job?

Thanks.

BigBirdy’s picture

Glad it was not just me. Found this out as well this morning and had to re-upload the images

sosiopanete’s picture

I have this problem too

bavarian’s picture

subscribing

mavimo’s picture

Status: Needs work » Needs review

Open file theme-settings.php on line 435 and add:

$file->status = FILE_STATUS_PERMANENT;

to have:

function _marinelli_save_image($file, $banner_folder = 'public://banner/', $banner_thumb_folder = 'public://banner/thumb/') {
  // Check directory and create it (if not exist)
  _marinelli_check_dir($banner_folder);
  _marinelli_check_dir($banner_thumb_folder);

  $parts = pathinfo($file->filename);
  $destination = $banner_folder . $parts['basename'];
  $setting = array();

  $file->status = FILE_STATUS_PERMANENT;
  
  // Copy temporary image into banner folder
  if ($img = file_copy($file, $destination, FILE_EXISTS_REPLACE)) {
    // Generate image thumb
    $image = image_load($destination);
    $small_img = image_scale($image, 300, 100);
    $image->source = $banner_thumb_folder . $parts['basename'];
    image_save($image);

    // Set image info
    $setting['image_path'] = $destination;
    $setting['image_thumb'] = $image->source;
    $setting['image_title'] = '';
    $setting['image_description'] = '';
    $setting['image_url'] = '<front>';
    $setting['image_published'] = FALSE;
    $setting['image_visibility'] = '*';

    return $setting;
  }
  
  return FALSE;
}

Please let me know if this patch solve the problem.

sosiopanete’s picture

It seems to work for me. But I insert only the code:

$file->status = FILE_STATUS_PERMANENT;

If I write <? php and ?> gives error when trying to access the theme settings.

I keep trying. Thanks.

mavimo’s picture

@sosiopanete: tht's correct, tags must NOT add into file ;)

drupjab’s picture

subscribing.

Lioz’s picture

HI folks, do you confirm that this bug is fixed in 3x-beta5?

mheinke’s picture

this seems to be working... i havn't found a problem with it yet.

mavimo’s picture

Status: Needs review » Closed (fixed)