fix(mssql): when updating an object by id, omit the id itself
It is a useless update and id is an identity column in MSSQL, which is not updatable and throws an error if you try. This affects the following seven objects (Models): - Category - CustomFilter - Group - Project - Subtask - TaskExternalLink - User
This commit is contained in:
committed by
Frédéric Guillot
parent
29df527979
commit
3df89f9df2
@@ -290,7 +290,9 @@ class UserModel extends Base
|
||||
public function update(array $values)
|
||||
{
|
||||
$this->prepare($values);
|
||||
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($values);
|
||||
$updates = $values;
|
||||
unset($updates['id']);
|
||||
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($updates);
|
||||
$this->userSession->refresh($values['id']);
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user