From dd67cab64fcee11adf2d64a67a844209ac0a63ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 29 Sep 2025 21:07:00 +0200 Subject: [PATCH] fix set project for actioncomm (#35543) --- htdocs/core/class/commonobject.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6f5a885d1d8..131daff63e9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2631,21 +2631,21 @@ abstract class CommonObject } $sql = "UPDATE ".$this->db->prefix().$this->table_element; - // @phan-suppress-next-line PhanTypeMismatchProperty - if (!empty($this->fields['fk_project'])) { // Common case - if ($projectid) { - $sql .= " SET fk_project = ".((int) $projectid); - } else { - $sql .= " SET fk_project = NULL"; - } - $sql .= ' WHERE rowid = '.((int) $this->id); - } elseif ($this->table_element == 'actioncomm') { // Special case for actioncomm + if ($this->table_element == 'actioncomm') { // Special case for actioncomm if ($projectid) { $sql .= " SET fk_project = ".((int) $projectid); } else { $sql .= " SET fk_project = NULL"; } $sql .= ' WHERE id = '.((int) $this->id); + // @phan-suppress-next-line PhanTypeMismatchProperty + } elseif (!empty($this->fields['fk_project'])) { // Common case + if ($projectid) { + $sql .= " SET fk_project = ".((int) $projectid); + } else { + $sql .= " SET fk_project = NULL"; + } + $sql .= ' WHERE rowid = '.((int) $this->id); } else { // Special case for old architecture objects if ($projectid) { $sql .= ' SET fk_projet = '.((int) $projectid);