HTML sitemap lists unpublished pages
维护者通常 1 天内回复
评估
调研方向
从 src/Web/Grand.Web/Features/Handlers/Common/GetSitemapHandler.cs 中的页面块入手,并将其筛选条件与 src/Business/Grand.Business.Messages/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs 中 XML 站点地图处理程序的筛选条件进行比较。在 Features/Handlers/Pages/GetPageBlockHandler.cs 中检查相关页面行为。完成标准是 /sitemap 排除未发布的页面,同时保留所述的站点地图和日期筛选条件;通过相关测试或使用一个未发布页面进行复现来验证该行为。
由索引模型根据 Issue 内容生成。
描述
What happens
The storefront HTML sitemap (/sitemap) lists CMS pages that are not published. The title of an unpublished page is shown publicly, and its link leads nowhere because the page itself checks Published and does not render.
Steps to reproduce
- In the admin panel create a page, tick "Include in sitemap" and leave "Published" unticked.
- Open
/sitemapon the storefront. - The page is listed under the pages section; following the link does not show the page.
Cause
src/Web/Grand.Web/Features/Handlers/Common/GetSitemapHandler.cs (pages block, around lines 110-114) takes pages from IPageService.GetAllPages(storeId), which does not filter on Published, and then filters only on IncludeInSitemap and the start/end dates.
The XML sitemap already does this correctly: src/Business/Grand.Business.Messages/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs (around line 332) filters on t.Published && t.IncludeInSitemap && .... The page view enforces Published in Features/Handlers/Pages/GetPageBlockHandler.cs.
Expected behaviour
Only published pages with "Include in sitemap" ticked (and within their start/end dates) appear on /sitemap, consistent with the XML sitemap.
- 主要语言
- C#
- 星标
- 1.3k
- 派生
- 549
- 平均合并
- 8 小时 14 分钟
- 30 天内合并 PR
- 55
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
grandnode/grandnode2 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 57/100
grandnode/grandnode2#900 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 65/100
grandnode/grandnode2#881 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
grandnode/grandnode2#880 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
grandnode/grandnode2#849 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 50/100
grandnode/grandnode2#499 ·
维护者通常 1 天内回复
查看 grandnode/grandnode2 的全部 Issue
相似的 Issue
-
A numeric literal is parsed in the host's culture, so 1.5 is 15 in a made EXE on a comma-decimal OS未关闭bug interpreter silently-wrong small
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
reactiveui/ReactiveUI.Binding.SourceGenerators#176 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 76/100
dotnet/csharpstandard#1830 ·
维护者通常 1 天内回复
-
c:docs p:high size:S t:docs
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复