summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r--routers/web/repo/issue.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index a9ce1cc1e7..7d8ec3a6f3 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -1647,9 +1647,22 @@ func ViewIssue(ctx *context.Context) {
return
}
} else if comment.Type == issues_model.CommentTypeAddTimeManual ||
- comment.Type == issues_model.CommentTypeStopTracking {
+ comment.Type == issues_model.CommentTypeStopTracking ||
+ comment.Type == issues_model.CommentTypeDeleteTimeManual {
// drop error since times could be pruned from DB..
_ = comment.LoadTime()
+ if comment.Content != "" {
+ // Content before v1.21 did store the formated string instead of seconds,
+ // so "|" is used as delimeter to mark the new format
+ if comment.Content[0] != '|' {
+ // handle old time comments that have formatted text stored
+ comment.RenderedContent = comment.Content
+ comment.Content = ""
+ } else {
+ // else it's just a duration in seconds to pass on to the frontend
+ comment.Content = comment.Content[1:]
+ }
+ }
}
if comment.Type == issues_model.CommentTypeClose || comment.Type == issues_model.CommentTypeMergePull {