fetchRedirect not working on handleError with Polylang translated slugs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- next.js, typescript, wordpress
Hướng nghiên cứu
Bắt đầu từ handleError và fetchRedirect, sau đó tái hiện thiết lập Polylang và Safe Redirect Manager được liệt kê với các slug của post type đã dịch. So sánh pathname của resolvedUrl trong ctx với đường dẫn có tiền tố locale mà WordPress mong đợi. Hoàn thành khi phát hiện được redirect từ đường dẫn đã dịch mà không hardcode pathname.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When having the Polylang integration enabled and slugs for post types are translated, the fetchRedirect pathname is not matching the translated slug in handleError, therefore a redirect added for a different locale in WP is not detected.
Steps to Reproduce
- Create custom post type., slug example 'programmes'
- Add translation to the post type slug in polylang, for example PT 'programas'
- Add rewrite in middleware so NextJS knows
programastranslated path isprogrammes/ - Add a redirect from from WP with Safe Redirect Manager from '/pt/programas/foo' that returns 404 to an existing page
- Within handleError function pathname is the ctx resolvedUrl which is programmes/foo
- See redirect not working.
- Inside handleError to test, hardcode pathname in fetchRedirect to '/pt/programas/foo' and see redirect working.
Screenshots, screen recording, code snippet
No response
Environment information
WP 6.4.3
Safe Redirect Manager 2.1.0
Polylang Pro 3.3.2
@headstartwp/core 1.1.2
@headstartwp/next 1.1.5
WordPress information
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- TypeScript
- Star
- 204
- Fork
- 26
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 10up/headstartwp
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
10up/headstartwp#950 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
10up/headstartwp#948 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
10up/headstartwp#902 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
10up/headstartwp#900 ·
-
Breaking Changes Roadmap / 2.0Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
10up/headstartwp#857 ·
Tất cả issue của 10up/headstartwp
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🛠️ dette technique
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
betagouv/mon-entreprise#4752 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
franciscoBSalgueiro/en-croissant#1111 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/providers type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#64845 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày