// 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)
|
||||
{
|
||||
if ((int)$max_file_size > 0 && $file['size'] > (int)$max_file_size)
|
||||
return sprintf(
|
||||
Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'),
|
||||
$file['size'] / 1000,
|
||||
$max_file_size / 1000
|
||||
);
|
||||
return sprintf(Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'), $file['size'] / 1024, $max_file_size / 1024);
|
||||
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');
|
||||
if ($file['error'])
|
||||
|
||||
@@ -3474,18 +3474,17 @@ class AdminProductsControllerCore extends AdminController
|
||||
$current_shop_id = 0;
|
||||
|
||||
$data->assign(array(
|
||||
'countImages' => $count_images,
|
||||
'id_product' => (int)Tools::getValue('id_product'),
|
||||
'id_category_default' => (int)$this->_category->id,
|
||||
'images' => $images,
|
||||
'token' => $this->token,
|
||||
'table' => $this->table,
|
||||
'max_image_size' => $this->max_image_size / 1024 / 1024,
|
||||
'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'),
|
||||
'currency' => $this->context->currency,
|
||||
'current_shop_id' => $current_shop_id
|
||||
)
|
||||
);
|
||||
'countImages' => $count_images,
|
||||
'id_product' => (int)Tools::getValue('id_product'),
|
||||
'id_category_default' => (int)$this->_category->id,
|
||||
'images' => $images,
|
||||
'token' => $this->token,
|
||||
'table' => $this->table,
|
||||
'max_image_size' => $this->max_image_size / 1024 / 1024,
|
||||
'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'),
|
||||
'currency' => $this->context->currency,
|
||||
'current_shop_id' => $current_shop_id
|
||||
));
|
||||
}
|
||||
else
|
||||
$this->displayWarning($this->l('You must save the product in this shop before adding images.'));
|
||||
|
||||
@@ -34,4 +34,6 @@ CREATE TABLE `PREFIX_tab_module_preference` (
|
||||
/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 1); */;
|
||||
|
||||
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