fix set project for actioncomm (#35543)
This commit is contained in:
parent
b84969a548
commit
dd67cab64f
1 changed files with 9 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue