From 0eb47096db02ceb5032c7439b3b901fbadd0d1bb Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 2 Oct 2022 13:44:56 +0200 Subject: [PATCH] fix: make cover image id actually updatable --- pkg/models/tasks.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/models/tasks.go b/pkg/models/tasks.go index 2596b453e8..21e8d3c1a6 100644 --- a/pkg/models/tasks.go +++ b/pkg/models/tasks.go @@ -1042,7 +1042,7 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) { "position", "repeat_mode", "kanban_position", - "cover_image_attachment_id", + "cover_image_attachment_id", // TODO: check if the attachment belongs to the task } // If the task is being moved between lists, make sure to move the bucket + index as well @@ -1152,6 +1152,10 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) { if !t.IsFavorite { ot.IsFavorite = false } + // Attachment cover image + if t.CoverImageAttachmentID == 0 { + ot.CoverImageAttachmentID = 0 + } _, err = s.ID(t.ID). Cols(colsToUpdate...).