fetchRedirect not working on handleError with Polylang translated slugs
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- next.js, typescript, wordpress
調査の方向性
handleError と fetchRedirect から始め、次に、翻訳された post-type slug を使って、記載されている Polylang と Safe Redirect Manager のセットアップを再現します。ctx の resolvedUrl の pathname を、WordPress が想定する locale プレフィックス付きパスと比較します。pathname をハードコードせずに、翻訳されたパスからのリダイレクトが検出されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 204
- フォーク
- 26
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
10up/headstartwp のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
10up/headstartwp#950 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
10up/headstartwp#948 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
10up/headstartwp#902 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
10up/headstartwp#900 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
10up/headstartwp#857 ·
10up/headstartwp の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
🛠️ dette technique
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
betagouv/mon-entreprise#4752 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
franciscoBSalgueiro/en-croissant#1111 ·
メンテナーはふだん 2 日以内に返信
-
area/providers type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#64845 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信