Fix: Add more log and missing error message
This commit is contained in:
parent
3f8ec47e91
commit
b0ebaec0da
@ -473,7 +473,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
}*/
|
||||
}
|
||||
if (isset($_POST["country"]) && $_POST["country"]=='0') {
|
||||
if (isset($_POST["country"]) && $_POST["country"]=='0')
|
||||
{
|
||||
$ok=0;
|
||||
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
|
||||
}
|
||||
@ -532,7 +533,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||
setEventMessage($langs->transnoentities("RecordSaved"));
|
||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -271,7 +271,7 @@ class DoliDBMysql extends DoliDB
|
||||
$this->lastqueryerror = $query;
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING);
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_WARNING);
|
||||
}
|
||||
$this->lastquery=$query;
|
||||
$this->_results = $ret;
|
||||
@ -825,12 +825,12 @@ class DoliDBMysql extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
|
||||
@ -273,7 +273,7 @@ class DoliDBMysqli extends DoliDB
|
||||
$this->lastqueryerror = $query;
|
||||
$this->lasterror = $this->error();
|
||||
$this->lasterrno = $this->errno();
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING);
|
||||
dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_WARNING);
|
||||
}
|
||||
$this->lastquery=$query;
|
||||
$this->_results = $ret;
|
||||
@ -829,12 +829,12 @@ class DoliDBMysqli extends DoliDB
|
||||
$resql=$this->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||
{
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// If user already exists, we continue to set permissions
|
||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user