// Fix access table for old mysql configurations
This commit is contained in:
+2
-2
@@ -250,7 +250,7 @@ abstract class DbCore
|
|||||||
*
|
*
|
||||||
* @param string $table Table where insert/update data
|
* @param string $table Table where insert/update data
|
||||||
* @param string $data Data to insert/update
|
* @param string $data Data to insert/update
|
||||||
* @param string $type INSERT or INSERT IGNORE or UPDATE
|
* @param string $type INSERT or INSERT IGNORE or REPLACE or UPDATE
|
||||||
* @param string $where WHERE clause, only for UPDATE (optional)
|
* @param string $where WHERE clause, only for UPDATE (optional)
|
||||||
* @param int $limit LIMIT clause (optional)
|
* @param int $limit LIMIT clause (optional)
|
||||||
* @param bool $use_cache
|
* @param bool $use_cache
|
||||||
@@ -263,7 +263,7 @@ abstract class DbCore
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
$type = strtoupper($type);
|
$type = strtoupper($type);
|
||||||
if ($type == 'INSERT' || $type == 'INSERT IGNORE')
|
if ($type == 'INSERT' || $type == 'INSERT IGNORE' || $type == 'REPLACE')
|
||||||
{
|
{
|
||||||
// Check if $data is a list of row
|
// Check if $data is a list of row
|
||||||
$current = current($data);
|
$current = current($data);
|
||||||
|
|||||||
@@ -406,7 +406,11 @@ class InstallXmlLoader
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create entity in database);
|
// Create entity in database);
|
||||||
if (!Db::getInstance()->autoExecute(_DB_PREFIX_.$entity, array_map('pSQL', $data), 'INSERT IGNORE'))
|
$execute_type = 'INSERT IGNORE';
|
||||||
|
if ($entity == 'access')
|
||||||
|
$execute_type = 'REPLACE';
|
||||||
|
|
||||||
|
if (!Db::getInstance()->autoExecute(_DB_PREFIX_.$entity, array_map('pSQL', $data), $execute_type))
|
||||||
$this->setError($this->language->l('An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>', $entity, Db::getInstance()->getMsgError()));
|
$this->setError($this->language->l('An SQL error occured for entity <i>%1$s</i>: <i>%2$s</i>', $entity, Db::getInstance()->getMsgError()));
|
||||||
$entity_id = Db::getInstance()->Insert_ID();
|
$entity_id = Db::getInstance()->Insert_ID();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user