2
0
forked from Wavyzz/dolibarr

FIX On object validation, ecm index are not updated for uploaded files

This commit is contained in:
Laurent Destailleur
2023-10-31 19:28:11 +01:00
parent a0c5dffacb
commit 74e1ec4099
37 changed files with 233 additions and 3 deletions

View File

@@ -569,6 +569,12 @@ class Commande extends CommonOrder
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'commande/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'commande/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
$error++; $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
$oldref = dol_sanitizeFileName($this->ref);