Skip to content
Snippets Groups Projects
Commit f4fc16a4 authored by Alexandre SPANGARO's avatar Alexandre SPANGARO
Browse files

Fix error 500

parent e64e380d
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,9 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co
## [Non Distribué]
## [7.0.46] - 07-02-2023
- Correction erreur php 500 (function _purgeExpiredFile())
## [7.0.45] - 18-01-2023
- Correction de la tache cron (retours de la fonction)
......
......@@ -1203,6 +1203,7 @@ class EdeDoc
$sql .= " FROM " . MAIN_DB_PREFIX . "demat4dolibarr_ededoc_file";
$sql .= " WHERE expire_date IS NOT NULL";
$sql .= " AND expire_date < NOW()";
$resql = $this->db->query($sql);
if (!$resql) {
$this->errors[] = 'Error ' . $this->db->lasterror();
......@@ -1211,14 +1212,14 @@ class EdeDoc
}
while ($obj = $this->db->fetch_object($resql)) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "demat4dolibarr_ededoc_file";
$sql .= " WHERE file_path = '" . $this->db->escape($obj->file_path) . "'";
$sql .= " AND document_id = '" . $this->db->escape($obj->document_id) . "'";
$sql .= " AND checksum = '" . $this->db->escape($obj->checksum) . "'";
$resql = $this->db->query($sql);
if (!$resql) {
$sql2 = "DELETE FROM " . MAIN_DB_PREFIX . "demat4dolibarr_ededoc_file";
$sql2 .= " WHERE file_path = '" . $this->db->escape($obj->file_path) . "'";
$sql2 .= " AND document_id = '" . $this->db->escape($obj->document_id) . "'";
$sql2 .= " AND checksum = '" . $this->db->escape($obj->checksum) . "'";
$resql2 = $this->db->query($sql2);
if (!$resql2) {
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . " SQL: " . $sql . "; Error: " . $this->db->lasterror(), LOG_ERR);
dol_syslog(__METHOD__ . " SQL: " . $sql2 . "; Error: " . $this->db->lasterror(), LOG_ERR);
return -1;
}
}
......
......@@ -74,7 +74,7 @@ class modDemat4Dolibarr extends DolibarrModules
$this->editor_url = 'http://www.open-dsi.fr';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = '7.0.45';
$this->version = '7.0.46';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
// Name of image file used for this module.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment