Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#461 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #468 @silverbackdan による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
php, symfony
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
PHP
スター
32
フォーク
8
平均マージ
58分
マージ済み PR(30日)
147

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

components-web-app/api-components-bundle のほかの issue

components-web-app/api-components-bundle の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。