/en gives 404 although the home page has an English translation
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- php
- Área
- backend, internationalization
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- JavaScript
- Estrellas
- 5
- Forks
- 9
- Merge medio
- 19 h 10 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Type: Bug Value: Coders
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
PlanBCode/hypha#586 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de PlanBCode/hypha
Issues similares
-
Add: OnTime Sports SD LogoAbiertocheck:failed logos:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
iptv-org/database#38874 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
githubnext/gh-aw-workshop#5193 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
agent/quality stage/040-covered-by-pr testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
cncf/endusers#2031 · 2 comentarios ·
Los mantenedores suelen responder en 1 día