[-] BO : fix regression on product image upload
This commit is contained in:
@@ -202,10 +202,9 @@ class QqUploadedFileXhr
|
|||||||
public function copyImage($id_product, $id_image, $method = 'auto')
|
public function copyImage($id_product, $id_image, $method = 'auto')
|
||||||
{
|
{
|
||||||
$image = new Image($id_image);
|
$image = new Image($id_image);
|
||||||
$p = new Product($id_product);
|
|
||||||
if (!$new_path = $image->getPathForCreation())
|
if (!$new_path = $image->getPathForCreation())
|
||||||
return array('error' => Tools::displayError('An error occurred during new folder creation'));
|
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'));
|
return array('error' => Tools::displayError('An error occurred during the image upload'));
|
||||||
elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format))
|
elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format))
|
||||||
return array('error' => Tools::displayError('An error occurred while copying image.'));
|
return array('error' => Tools::displayError('An error occurred while copying image.'));
|
||||||
|
|||||||
Reference in New Issue
Block a user