From dd333fc2aa7989187c7e77c4aff0bae1713b81a7 Mon Sep 17 00:00:00 2001 From: leosw Date: Sun, 18 Jan 2026 13:10:57 +0100 Subject: [PATCH] Correction de la modif de l'attribut "is_commentable" dans le blog --- controllers/d.blog.php | 2 +- models/d.blog.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/d.blog.php b/controllers/d.blog.php index 4d93d3a..9e50180 100755 --- a/controllers/d.blog.php +++ b/controllers/d.blog.php @@ -104,7 +104,7 @@ switch ($controller->splitted_url[1]) { $blogArticle->content = $_POST['content']; $blogArticle->locale = $_POST['locale']; $blogArticle->name = $_POST['name']; - $blogArticle->is_commentable = isset($_POST['is_commentable'])?'t':'f'; + $blogArticle->is_commentable = $_POST['is_commentable']; $blogArticle->author = $user->id; $blogArticle->update(); header('Location: '.$config['rel_root_folder']."blog/".$blogArticle->permalink); diff --git a/models/d.blog.php b/models/d.blog.php index 984f9f1..74ed053 100755 --- a/models/d.blog.php +++ b/models/d.blog.php @@ -130,6 +130,12 @@ class BlogArticle $result = pg_execute($con, "prepare3", array($this->locale_id, $user->id)) or die ("Cannot execute statement\n"); + $query = "UPDATE contents SET is_commentable = $1 WHERE id = $2"; + pg_prepare($con, "prepare4", $query) + or die ("Cannot prepare statement\n"); + pg_execute($con, "prepare4", array($this->is_commentable ? 't' : 'f', $this->content_id)) + or die ("Cannot prepare statement\n"); + pg_close($con); error_log(