From 9225668f737103fcf44e1bd419281ad614376e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9B=B0=E5=9B=B0=E9=B1=BC?= <89380218+chengzhongxue@users.noreply.github.com> Date: Fri, 18 Apr 2025 18:38:27 +0800 Subject: [PATCH] fix: resolve issue with categoryName parameter not working in postFinder.list() (#7350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug #### What this PR does / why we need it: 修复 postFinder.list() 传参 categoryName 查询不到子类文章 #### Which issue(s) this PR fixes: Fixes #7296 #### Does this PR introduce a user-facing change? ```release-note 修复 postFinder.list() 的 categoryName 参数无效的问题 ``` --- .../java/run/halo/app/theme/finders/impl/PostFinderImpl.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/application/src/main/java/run/halo/app/theme/finders/impl/PostFinderImpl.java b/application/src/main/java/run/halo/app/theme/finders/impl/PostFinderImpl.java index 95be322a6..a18d0fe7d 100644 --- a/application/src/main/java/run/halo/app/theme/finders/impl/PostFinderImpl.java +++ b/application/src/main/java/run/halo/app/theme/finders/impl/PostFinderImpl.java @@ -325,10 +325,6 @@ public class PostFinderImpl implements PostFinder { builder.andQuery(equal("spec.tags", tagName)); hasQuery = true; } - if (StringUtils.isNotBlank(categoryName)) { - builder.andQuery(in("spec.categories", categoryName)); - hasQuery = true; - } // Exclude hidden posts when no query if (!hasQuery) { builder.fieldQuery(notHiddenPostQuery());