From 31a3ba8e6aaa4c551cb5c1aee2ab0202a07b3163 Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Thu, 5 May 2022 09:40:46 -0600 Subject: [PATCH] allow duplicating cards/baords if filecopy fails (#3012) * allow duplicating cards/baords if filecopy fails * change back to error logs --- server/app/blocks.go | 2 -- server/app/boards.go | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/server/app/blocks.go b/server/app/blocks.go index ac65943ed..14ce67be2 100644 --- a/server/app/blocks.go +++ b/server/app/blocks.go @@ -239,8 +239,6 @@ func (a *App) CopyCardFiles(sourceBoardID string, copiedBlocks []model.Block) er mlog.String("destinationFilePath", destinationFilePath), mlog.Err(err), ) - - return err } block.Fields["fileId"] = destFilename } diff --git a/server/app/boards.go b/server/app/boards.go index ec7c756a6..672c81fc6 100644 --- a/server/app/boards.go +++ b/server/app/boards.go @@ -150,11 +150,7 @@ func (a *App) DuplicateBoard(boardID, userID, toTeam string, asTemplate bool) (* // copy any file attachments from the duplicated blocks. if err = a.CopyCardFiles(boardID, bab.Blocks); err != nil { - dbab := model.NewDeleteBoardsAndBlocksFromBabs(bab) - if err = a.store.DeleteBoardsAndBlocks(dbab, userID); err != nil { - a.logger.Error("Cannot delete board after duplication error when copying block's files", mlog.String("boardID", bab.Boards[0].ID), mlog.Err(err)) - } - return nil, nil, fmt.Errorf("could not copy files while duplicating board %s: %w", boardID, err) + a.logger.Error("Could not copy files while duplicating board", mlog.String("BoardID", boardID), mlog.Err(err)) } // bab.Blocks now has updated file ids for any blocks containing files. We need to store them.