Skip to content
Snippets Groups Projects
Commit 807fad40 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: More log to hunt a bug

parent e3b1c513
No related branches found
No related tags found
No related merge requests found
...@@ -141,12 +141,16 @@ if ($_GET["action"] == 'setdoc') ...@@ -141,12 +141,16 @@ if ($_GET["action"] == 'setdoc')
// On active le modele // On active le modele
$type='invoice'; $type='invoice';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del.= " WHERE nom = '".$_GET["value"]."'"; $sql_del.= " WHERE nom = '".addslashes($_GET["value"])."'";
$sql_del.= " AND type = '".$type."'"; $sql_del.= " AND type = '".$type."'";
$sql_del.= " AND entity = ".$conf->entity; $sql_del.= " AND entity = ".$conf->entity;
dol_syslog("facture.php ".$sql_del);
$result1=$db->query($sql_del); $result1=$db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type,entity) VALUES ('".$_GET["value"]."','".$type."',".$conf->entity.")";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type,entity) VALUES ('".addslashes($_GET["value"])."','".$type."',".$conf->entity.")";
dol_syslog("facture.php ".$sql);
$result2=$db->query($sql); $result2=$db->query($sql);
if ($result1 && $result2) if ($result1 && $result2)
{ {
...@@ -154,6 +158,7 @@ if ($_GET["action"] == 'setdoc') ...@@ -154,6 +158,7 @@ if ($_GET["action"] == 'setdoc')
} }
else else
{ {
dol_syslog("facture.php ".$db->lasterror(), LOG_ERR);
$db->rollback(); $db->rollback();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment