This commit is contained in:
Lizandro Guarnizo
2026-03-16 20:29:21 -05:00
parent 8907f8fa95
commit 5f7cc67dd9
2 changed files with 11 additions and 2 deletions
+2 -1
View File
@@ -75,7 +75,8 @@ class Formulario {
$campos = array_intersect_key($datos, array_flip($permitidos));
if (isset($campos['esquema'])) {
$this->validarEsquema($campos['esquema']);
$campos['version'] = (int)$this->db->fetch('SELECT version FROM lab_formularios WHERE id = ?', [$id])['version'] + 1;
$row = $this->db->fetch('SELECT version FROM lab_formularios WHERE id = ?', [$id]);
$campos['version'] = (int)($row['version'] ?? 0) + 1;
}
$ok = $this->db->update('lab_formularios', $campos, 'id = ?', [$id]);
$this->log->registrar($adminId, 'formularios', 'editar', $id, $campos);