Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

HTML sitemap lists unpublished pages

Đã đóng Phù hợp với người mới
#883 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@KrzysztofPajak đang làm issue này rồi.

Từ ngày 7/10/2026.

  • #884 của @KrzysztofPajak — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với khối trang trong src/Web/Grand.Web/Features/Handlers/Common/GetSitemapHandler.cs và so sánh các bộ lọc của nó với bộ lọc trong trình xử lý sitemap XML tại src/Business/Grand.Business.Messages/Commands/Handlers/Common/GetSitemapXMLCommandHandler.cs. Kiểm tra hành vi liên quan đến trang trong Features/Handlers/Pages/GetPageBlockHandler.cs. Công việc hoàn tất khi /sitemap loại trừ các trang chưa xuất bản nhưng vẫn giữ các bộ lọc sitemap và ngày đã nêu; xác minh hành vi bằng các bài kiểm thử liên quan hoặc tái hiện bằng một trang chưa xuất bản.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

  1. In the admin panel create a page, tick "Include in sitemap" and leave "Published" unticked.
  2. Open /sitemap on the storefront.
  3. 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.

Ngôn ngữ chính
C#
Star
1.3k
Fork
549
Merge trung bình
8 giờ 14 phút
Pull request đã merge (30 ngày)
53

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của grandnode/grandnode2

Tất cả issue của grandnode/grandnode2

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.