/en gives 404 although the home page has an English translation
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- php
調査の方向性
Start with loadPage() in system/core/pages.php, hypha_setBodyClass() in system/core/base.php, and logout() in system/core/users.php; compare how each uses the configured default page name across languages. The issue describes the expected behavior for translated home pages and the missing-translation case. Linked pull request #609 already implements a suggested fix, so review its changes and verify the reported /en and /fr behavior if taking this further.
索引モデルが issue の本文から書いたものです。
説明
On a site with more than one content language, the root of a second language gives 404, although the home page has a translation in that language. Search engines and visitors who go to /en (or follow a link to it) get "This page doesn't exist".
Example (default language nl, default page Start, English translation of the home page named Home):
| Request | Answer on main |
|---|---|
/, /nl, /nl/Start |
200, the Dutch home page |
/en/Home |
200, the English home page, but without the body class is_home |
/en, /en/ |
404 |
| logout on a private English page | redirect to /en/, so 404 |
Cause. loadPage() (system/core/pages.php:250-254) takes the name of the default page from the settings, which is its name in the default language (Start), and looks that name up in the requested language: hypha_getPage('en', 'Start'). The translation has its own name (Home), so nothing is found. logout() (system/core/users.php:55-60) intends to send the visitor to the home page in the current language and redirects to <language>/ when the page itself is private, which runs into the same 404. hypha_setBodyClass() (system/core/base.php:653) compares the page name with that same setting, so only the default-language version of the home page gets is_home (themes use it for the home layout), and any other page that happens to be named Start in another language gets it as well.
Evidence (PHP 8.2 container of docs/container, fictional test site):
$ curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8172/en
404
$ curl -s http://127.0.0.1:8172/en/Home | grep -o '<body[^>]*>'
<body class="Home type_textpage lang_en tag_tag4 tag_Culture">
Suggested fix. When the request has no page name, look up the default page in the default language and show its translation in the requested language when there is one (still 404 when there is none, such as /fr). Set is_home by page id. The linked pull request does that; logout then lands on the English home page without further change. Whether /en should instead redirect (301) to /en/Home belongs to the canonical-URL question of #521; /nl shows the home page without a redirect today, so the pull request does the same for /en.
Found while checking multilingual sites for SEO. Tested in the PHP 8.2 and 8.5 containers of docs/container with a fictional test site: reproduces on main (d97ab7b), gone with the linked pull request, which is offered as a suggestion and a starting point.
🤖 Generated with Claude Code
- 主要言語
- JavaScript
- スター
- 5
- フォーク
- 9
- 平均マージ
- 18時間 7分
- マージ済み PR(30日)
- 11
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PlanBCode/hypha のほかの issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
Impact: Low Level: Easy Type: Bug Value: Coders
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
PlanBCode/hypha#586 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
PlanBCode/hypha の issue をすべて見る
似ている issue
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsオープンep:WebGPU platform:web quantization
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/onnxruntime#33752 ·
メンテナーはふだん 2 日以内に返信
-
icon request
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
tabler/tabler-icons#1693 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
alvarotrigo/fullPage.js#4755 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
jlab-sensing/ENTS-backend#854 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
andromarces/agent-loops#1242 ·
メンテナーはふだん 1 日以内に返信