// Unit changed for product pictures, I set it up to a usable minimum #PSCFV-6597
This commit is contained in:
@@ -270,11 +270,7 @@ class ImageManagerCore
|
|||||||
public static function validateUpload($file, $max_file_size = 0)
|
public static function validateUpload($file, $max_file_size = 0)
|
||||||
{
|
{
|
||||||
if ((int)$max_file_size > 0 && $file['size'] > (int)$max_file_size)
|
if ((int)$max_file_size > 0 && $file['size'] > (int)$max_file_size)
|
||||||
return sprintf(
|
return sprintf(Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'), $file['size'] / 1024, $max_file_size / 1024);
|
||||||
Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'),
|
|
||||||
$file['size'] / 1000,
|
|
||||||
$max_file_size / 1000
|
|
||||||
);
|
|
||||||
if (!ImageManager::isRealImage($file['tmp_name'], $file['type']) || !ImageManager::isCorrectImageFileExt($file['name']))
|
if (!ImageManager::isRealImage($file['tmp_name'], $file['type']) || !ImageManager::isCorrectImageFileExt($file['name']))
|
||||||
return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png');
|
return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png');
|
||||||
if ($file['error'])
|
if ($file['error'])
|
||||||
|
|||||||
@@ -3474,18 +3474,17 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$current_shop_id = 0;
|
$current_shop_id = 0;
|
||||||
|
|
||||||
$data->assign(array(
|
$data->assign(array(
|
||||||
'countImages' => $count_images,
|
'countImages' => $count_images,
|
||||||
'id_product' => (int)Tools::getValue('id_product'),
|
'id_product' => (int)Tools::getValue('id_product'),
|
||||||
'id_category_default' => (int)$this->_category->id,
|
'id_category_default' => (int)$this->_category->id,
|
||||||
'images' => $images,
|
'images' => $images,
|
||||||
'token' => $this->token,
|
'token' => $this->token,
|
||||||
'table' => $this->table,
|
'table' => $this->table,
|
||||||
'max_image_size' => $this->max_image_size / 1024 / 1024,
|
'max_image_size' => $this->max_image_size / 1024 / 1024,
|
||||||
'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'),
|
'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'),
|
||||||
'currency' => $this->context->currency,
|
'currency' => $this->context->currency,
|
||||||
'current_shop_id' => $current_shop_id
|
'current_shop_id' => $current_shop_id
|
||||||
)
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$this->displayWarning($this->l('You must save the product in this shop before adding images.'));
|
$this->displayWarning($this->l('You must save the product in this shop before adding images.'));
|
||||||
|
|||||||
@@ -35,3 +35,5 @@ CREATE TABLE `PREFIX_tab_module_preference` (
|
|||||||
|
|
||||||
ALTER TABLE `PREFIX_stock_available` DROP INDEX `product_sqlstock`;
|
ALTER TABLE `PREFIX_stock_available` DROP INDEX `product_sqlstock`;
|
||||||
ALTER TABLE `PREFIX_stock_available` ADD UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`);
|
ALTER TABLE `PREFIX_stock_available` ADD UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`);
|
||||||
|
|
||||||
|
UPDATE PREFIX_configuration SET `value` = '8388608' WHERE `name` = 'PS_PRODUCT_PICTURE_MAX_SIZE' AND `value` <= '524288';
|
||||||
|
|||||||
Reference in New Issue
Block a user