[-] BO : Fix bug #PSCFV-7353 can not see the thumb for a scene

This commit is contained in:
gRoussac
2013-06-24 14:50:10 +02:00
parent ec426f170f
commit 50c88dc4de
2 changed files with 23 additions and 25 deletions
+5 -12
View File
@@ -116,19 +116,12 @@ class SceneCore extends ObjectModel
}
public function deleteImage($force_delete = false)
{
// Hack to prevent the main scene image from being deleted in AdminController::uploadImage() when a thumb image is uploaded
if (isset($_FILES['thumb']) && (!isset($_FILES['image']) || empty($_FILES['image']['name'])))
return true;
if (parent::deleteImage())
{
if (file_exists($this->image_dir.'thumbs/'.$this->id.'-thumb_scene.'.$this->image_format)
&& !unlink($this->image_dir.'thumbs/'.$this->id.'-thumb_scene.'.$this->image_format))
return false;
}
else
{
if (file_exists($this->image_dir.'thumbs/'.$this->id.'-m_scene_default.'.$this->image_format)
&& !unlink($this->image_dir.'thumbs/'.$this->id.'-m_scene_default.'.$this->image_format))
return false;
if (!(isset($_FILES) && count($_FILES)))
return parent::deleteImage();
return true;
}