[-] Installer : fixed errors at the installation with insertion of null values in the database #PSCFV-3544
This commit is contained in:
@@ -270,7 +270,7 @@ abstract class ObjectModelCore
|
||||
$fields = array_merge($fields, $this->getFieldsShop());
|
||||
|
||||
// Ensure that we get something to insert
|
||||
if (!$fields)
|
||||
if (!$fields && $this->id)
|
||||
$fields[$this->def['primary']] = $this->id;
|
||||
return $fields;
|
||||
}
|
||||
@@ -286,7 +286,7 @@ abstract class ObjectModelCore
|
||||
public function getFieldsShop()
|
||||
{
|
||||
$fields = $this->formatFields(self::FORMAT_SHOP);
|
||||
if (!$fields)
|
||||
if (!$fields && $this->id)
|
||||
$fields[$this->def['primary']] = $this->id;
|
||||
return $fields;
|
||||
}
|
||||
|
||||
+1
-1
@@ -322,7 +322,7 @@ abstract class DbCore
|
||||
*/
|
||||
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;
|
||||
|
||||
if ($add_prefix)
|
||||
|
||||
Reference in New Issue
Block a user