Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#461 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@silverbackdan is already working on this.

Since Oct 16, 2026.

  • #468 by @silverbackdan — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
php, symfony
Domain
backend

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
PHP
Stars
32
Forks
8
Avg merge
40m
Merged PRs (30d)
133

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from components-web-app/api-components-bundle

All issues in components-web-app/api-components-bundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.