diff --git a/modules/todo/api.php b/modules/todo/api.php index 8c8cb7e..c92d4ea 100644 --- a/modules/todo/api.php +++ b/modules/todo/api.php @@ -1,4 +1,5 @@ prepare("INSERT INTO pf_todos (list_id, title, notes, due_date, due_time, priority) VALUES (?,?,?,?,?,?)") ->execute([ - $d['list_id'] ?: null, + ($d['list_id'] ?? null) ?: null, $title, $d['notes'] ?? null, - $d['due_date'] ?: null, - $d['due_time'] ?: null, + ($d['due_date'] ?? null) ?: null, + ($d['due_time'] ?? null) ?: null, $d['priority'] ?? 'none' ]); $id = (int)$pdo->lastInsertId(); @@ -147,7 +148,7 @@ if ($action === 'todos') { $title = trim($d['title'] ?? ''); if (!$title) tErr('Titre requis'); // Reset notified_date so cron fires again today if time changed $pdo->prepare("UPDATE pf_todos SET list_id=?, title=?, notes=?, due_date=?, due_time=?, priority=?, notified_date=NULL, updated_at=NOW() WHERE id=?") - ->execute([$d['list_id'] ?: null, $title, $d['notes'] ?? null, $d['due_date'] ?: null, $d['due_time'] ?: null, $d['priority'] ?? 'none', $id]); + ->execute([($d['list_id'] ?? null) ?: null, $title, $d['notes'] ?? null, ($d['due_date'] ?? null) ?: null, ($d['due_time'] ?? null) ?: null, $d['priority'] ?? 'none', $id]); tOk(['updated' => true]); }