[-] BO : BugFix : PSTEST-196 : Adding a supplier with a photo redirects you to the list and not to the edition of this supplier anymore

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12903 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-02-01 15:09:09 +00:00
parent e88732e30b
commit ecdc4a67db
@@ -311,6 +311,7 @@ class AdminSuppliersControllerCore extends AdminController
public function afterImageUpload() public function afterImageUpload()
{ {
$return = true;
/* Generate image with differents size */ /* Generate image with differents size */
if (($id_supplier = (int)Tools::getValue('id_supplier')) && if (($id_supplier = (int)Tools::getValue('id_supplier')) &&
isset($_FILES) && count($_FILES) && file_exists(_PS_SUPP_IMG_DIR_.$id_supplier.'.jpg')) isset($_FILES) && count($_FILES) && file_exists(_PS_SUPP_IMG_DIR_.$id_supplier.'.jpg'))
@@ -319,9 +320,11 @@ class AdminSuppliersControllerCore extends AdminController
foreach ($images_types as $k => $image_type) foreach ($images_types as $k => $image_type)
{ {
$file = _PS_SUPP_IMG_DIR_.$id_supplier.'.jpg'; $file = _PS_SUPP_IMG_DIR_.$id_supplier.'.jpg';
ImageManager::resize($file, _PS_SUPP_IMG_DIR_.$id_supplier.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], (int)$image_type['height']); if (!ImageManager::resize($file, _PS_SUPP_IMG_DIR_.$id_supplier.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], (int)$image_type['height']))
$return = false;
} }
} }
return $return;
} }
/** /**