[-] Installer : fixed errors at the installation with insertion of null values in the database #PSCFV-3544

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16758 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger committed 2012-08-08 09:23:31 +00:00
1 parent f74b6c667c
commit 8479ef58ee
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -270,7 +270,7 @@ abstract class ObjectModelCore
$fields = array_merge($fields, $this->getFieldsShop()); $fields = array_merge($fields, $this->getFieldsShop());
// Ensure that we get something to insert // Ensure that we get something to insert
if (!$fields) if (!$fields && $this->id)
$fields[$this->def['primary']] = $this->id; $fields[$this->def['primary']] = $this->id;
return $fields; return $fields;
} }
@@ -286,7 +286,7 @@ abstract class ObjectModelCore
public function getFieldsShop() public function getFieldsShop()
{ {
$fields = $this->formatFields(self::FORMAT_SHOP); $fields = $this->formatFields(self::FORMAT_SHOP);
if (!$fields) if (!$fields && $this->id)
$fields[$this->def['primary']] = $this->id; $fields[$this->def['primary']] = $this->id;
return $fields; return $fields;
} }
+1 -1
View File
@@ -322,7 +322,7 @@ abstract class DbCore
*/ */
public function insert($table, $data, $null_values = false, $use_cache = true, $type = Db::INSERT, $add_prefix = true) public function insert($table, $data, $null_values = false, $use_cache = true, $type = Db::INSERT, $add_prefix = true)
{ {
if (!$data) if (!$data && !$null_values)
return true; return true;
if ($add_prefix) if ($add_prefix)