[-] BO : fix regression on product image upload

This commit is contained in:
tDidierjean
2012-01-25 14:21:53 +00:00
parent 15d1583f12
commit 43ba22fd2f
+1 -2
View File
@@ -202,10 +202,9 @@ class QqUploadedFileXhr
public function copyImage($id_product, $id_image, $method = 'auto')
{
$image = new Image($id_image);
$p = new Product($id_product);
if (!$new_path = $image->getPathForCreation())
return array('error' => Tools::displayError('An error occurred during new folder creation'));
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !$this->upload($tmpName))
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !$this->upload($tmpName))
return array('error' => Tools::displayError('An error occurred during the image upload'));
elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format))
return array('error' => Tools::displayError('An error occurred while copying image.'));