// Fix duplication of images

This commit is contained in:
rMalie committed 2011-12-20 09:40:59 +00:00
1 parent 2f92d7d271
commit 2947749755
2 files changed
+7 -1

No files matched your search

+1
View File
@@ -236,6 +236,7 @@ class ImageCore extends ObjectModel
{ {
$image_old = new Image($row['id_image']); $image_old = new Image($row['id_image']);
$image_new = clone $image_old; $image_new = clone $image_old;
unset($image_new->id);
$image_new->id_product = (int)$id_product_new; $image_new->id_product = (int)$id_product_new;
// A new id is generated for the cloned image when calling add() // A new id is generated for the cloned image when calling add()
if ($image_new->add()) if ($image_new->add())
+6 -1
View File
@@ -270,7 +270,7 @@ abstract class ObjectModelCore
$fields = array(); $fields = array();
// Set primary key in fields // Set primary key in fields
if ($this->id) if (isset($this->id))
$fields[$this->def['primary']] = $this->id; $fields[$this->def['primary']] = $this->id;
// Set id_lang field for multilang fields and id_shop for multishop field // 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; $this->def['fields'][$field]['size'] = $size;
} }
} }
public function getEntity($entity)
{
}
} }