Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

generate-fixtures drops a redirect on a route that also has a page

Cerrado
#461 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Ya se ha fusionado un pull request relacionado.

  • #468 de @silverbackdan — fusionado

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
php, symfony
Área
backend

Línea de trabajo

Start with Fixture/Generator/Site/SiteReader::orderRedirects(), where the !isset($available[spl_object_id($route)]) check skips redirects on routes that also belong to a page, and check how $unresolvedRedirects is populated. Pull request #468 is already open against this issue, so review it before starting. Done means the generated scaffold sets the redirect after the routes exist, or the route is reported under could not be reproduced.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

silverback:api-components:generate-fixtures (2.0.0-alpha.22) silently leaves out a redirect when the redirecting route also belongs to a page. Nothing appears in the could not be reproduced list.

Example (smoking-and-alcohol-websites production)

Route Page Redirects to
/ (home) Home /graphs
/graphs (graphs) Graphs /graphs/top-line-findings
/resources (resources) Resources /resources/latest-statistics

The generated scaffold creates all three pages with their routes, but contains no $cwa->redirect() call and no other redirect. A site loaded from it serves an empty Home page at / instead of redirecting.

Cause

In Fixture/Generator/Site/SiteReader::orderRedirects(), only routes not already in $siteRoutes become pending redirects:

if (null !== $route->getRedirect() && !isset($available[spl_object_id($route)])) {

A page's own route is in $siteRoutes, so its redirect is skipped. It isn't added to $unresolvedRedirects either, so nothing gets reported.

Expected

The redirect is carried. For a route that is both a page's route and a redirect, the scaffold should set the redirect after the routes exist, for example in an onRoutesCreated() / afterRoutes() callback ($cwa->getRoute('home')->setRedirect($cwa->getRoute('graphs')), or a builder equivalent). Failing that, it should at least be listed under could not be reproduced.

Downstream workaround: a small fixture that depends on the generated scaffold and sets the three redirects when they're missing.

Lenguaje dominante
PHP
Estrellas
32
Forks
8
Merge medio
1 h 1 min
PR fusionados (30 d)
159

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de components-web-app/api-components-bundle

Todos los issues de components-web-app/api-components-bundle

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.