From fa87a57b591cc3ceae6870fc1dfa2408ee8ac640 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 27 Mar 2024 13:44:26 +0900 Subject: [PATCH] Load attachments for code comments (#30124) Fix #30103 ps: comments has `LoadAttributes`, but maybe considering performance problem, we don't call it. (cherry picked from commit ce3c3512265df3b4940672be40065c4fb415ef95) --- models/issues/comment_code.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/issues/comment_code.go b/models/issues/comment_code.go index cef2ea281c..735c9f0893 100644 --- a/models/issues/comment_code.go +++ b/models/issues/comment_code.go @@ -117,6 +117,10 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu return nil, err } + if err := comments.LoadAttachments(ctx); err != nil { + return nil, err + } + // Find all reviews by ReviewID reviews := make(map[int64]*Review) ids := make([]int64, 0, len(comments))