Fix avoid errors with postgresql
This commit is contained in:
parent
d186aed96c
commit
2f9cc1c919
@ -219,12 +219,22 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
|
||||
if ($success)
|
||||
{
|
||||
// Insert MAIN_VERSION_FIRST_INSTALL in a dedicated transaction. So if it fails (when first install was already done), we can do other following requests.
|
||||
$db->begin();
|
||||
|
||||
dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL',1).",".$db->encrypt($targetversion,1).",'chaine',0,'Dolibarr version when first install',0)");
|
||||
//if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
|
||||
$conf->global->MAIN_VERSION_FIRST_INSTALL=$targetversion;
|
||||
if ($resql)
|
||||
{
|
||||
$conf->global->MAIN_VERSION_FIRST_INSTALL=$targetversion;
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
|
||||
$db->commit();
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
|
||||
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user