// Log for product deletion was missing
This commit is contained in:
@@ -359,18 +359,17 @@ class AdminProductsControllerCore extends AdminController
|
||||
$result = parent::loadObject($opt);
|
||||
if ($result && Validate::isLoadedObject($this->object))
|
||||
{
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && !$this->object->isAssociatedToShop())
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && Shop::isFeatureActive() && !$this->object->isAssociatedToShop())
|
||||
{
|
||||
$default_product = new Product((int)$this->object->id, false, null, (int)$this->object->id_shop_default);
|
||||
$def = ObjectModel::getDefinition($this->object);
|
||||
foreach ($def['fields'] as $field_name => $row)
|
||||
{
|
||||
$fields_array = array();
|
||||
if(is_array($default_product->$field_name))
|
||||
foreach ($fields_array as $key => $fields_name)
|
||||
if (is_array($default_product->$field_name))
|
||||
foreach ($default_product->$field_name as $key => $fields_name)
|
||||
$this->object->$field_name[$key] = ObjectModel::formatValue($fields_name, $def['fields'][$field_name]['type']);
|
||||
else
|
||||
$this->object->$field_name = ObjectModel::formatValue($this->object->$field_name, $def['fields'][$field_name]['type']);
|
||||
$this->object->$field_name = ObjectModel::formatValue($default_product->$field_name, $def['fields'][$field_name]['type']);
|
||||
}
|
||||
}
|
||||
$this->object->loadStockData();
|
||||
@@ -631,6 +630,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
{
|
||||
$id_category = (int)Tools::getValue('id_category');
|
||||
$category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category;
|
||||
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id);
|
||||
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user