1
0

fix(migration): ensure project background gets exported and imported

(cherry picked from commit ebfd5f54d2e4644aa2076c57a9b50ed5b87deaa9)
This commit is contained in:
kolaente
2024-08-12 17:18:07 +02:00
parent d08e9650ba
commit de9f686480
2 changed files with 14 additions and 1 deletions

View File

@ -228,7 +228,15 @@ func addDetailsToProjectAndChildren(p *models.ProjectWithTasksAndBuckets, stored
}
func addDetailsToProject(l *models.ProjectWithTasksAndBuckets, storedFiles map[int64]*zip.File) (err error) {
if b, exists := storedFiles[l.BackgroundFileID]; exists {
var backgroundFileID int64
bginfo, is := l.BackgroundInformation.(map[string]interface{})
if is {
bgid, has := bginfo["id"]
if has {
backgroundFileID = int64(bgid.(float64))
}
}
if b, exists := storedFiles[backgroundFileID]; exists {
bf, err := b.Open()
if err != nil {
return fmt.Errorf("could not open project background file %d for reading: %w", l.BackgroundFileID, err)