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...).