// Fix duplication of images
This commit is contained in:
@@ -236,6 +236,7 @@ class ImageCore extends ObjectModel
|
||||
{
|
||||
$image_old = new Image($row['id_image']);
|
||||
$image_new = clone $image_old;
|
||||
unset($image_new->id);
|
||||
$image_new->id_product = (int)$id_product_new;
|
||||
// A new id is generated for the cloned image when calling add()
|
||||
if ($image_new->add())
|
||||
|
||||
@@ -270,7 +270,7 @@ abstract class ObjectModelCore
|
||||
$fields = array();
|
||||
|
||||
// Set primary key in fields
|
||||
if ($this->id)
|
||||
if (isset($this->id))
|
||||
$fields[$this->def['primary']] = $this->id;
|
||||
|
||||
// Set id_lang field for multilang fields and id_shop for multishop field
|
||||
@@ -1259,4 +1259,9 @@ abstract class ObjectModelCore
|
||||
$this->def['fields'][$field]['size'] = $size;
|
||||
}
|
||||
}
|
||||
|
||||
public function getEntity($entity)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user