Releases: Setono/SyliusRedirectPlugin
3.0.0-alpha.2
Sylius Redirect Plugin 3.0.0-alpha.2
Second alpha of the 3.x line. Builds on 3.0.0-alpha with one new feature and one consistency fix around it.
What's new since 3.0.0-alpha
-
Toggle the always-on request listener (#113). New config option
setono_sylius_redirect.allow_non_404_redirects(defaulttrue). Set it tofalseif you only use 404-only redirects — the plugin stops registering itsKernelEvents::REQUESTlistener, so the per-request database query disappears. TheNotFoundSubscribercontinues to handle the 404 path unchanged.# config/packages/setono_sylius_redirect.yaml setono_sylius_redirect: allow_non_404_redirects: false # default: true
-
Admin form and validation are aware of the toggle. When
allow_non_404_redirectsisfalse, the Only when 404 checkbox is dropped from the redirect admin form (new redirects keep the model defaultonly404 = true), and a class-level constraint onRedirectrejects any save — form, API, CLI, fixtures — whereonly404 = false. This keeps the database from collecting redirects that would never fire.Pre-existing
only404 = falserows go dormant when you flip the toggle off; flip it back, delete them, or update them toonly404 = trueto bring them back to life.
Upgrade
No action needed if you're already on 3.0.0-alpha — the new option defaults to true, preserving the alpha behavior. See UPGRADE.md for the full 2.x → 3.0 migration guide.
This is still an alpha — please report issues at https://github.com/Setono/SyliusRedirectPlugin/issues so we can stabilize for the 3.0.0 release.
v3.0.0-alpha
Sylius Redirect Plugin 3.0.0-alpha
First alpha of the 3.x line. The plugin now targets Sylius 2.x, PHP 8.2+, and Symfony 6.4 / 7.x, and has been modernized end-to-end. See UPGRADE.md for the full migration guide; the highlights are below.
Highlights
- Sylius 2.x compatibility. Plugin layout aligned with the Sylius 2.x skeleton (
Resources/{config,translations,views}moved to the repository root). Admin UI rebuilt around Sylius Twig hooks. - Service configuration migrated from XML to PHP DSL. All
config/services/*.xmlfiles are gone; same service ids, arguments, tags, decorators, and aliases as before. - Plugin-owned service ids migrated to FQCNs. Snake-cased ids like
setono_sylius_redirect.resolver.redirection_pathare now their concrete class name (Setono\SyliusRedirectPlugin\Resolver\RedirectionPathResolver). Interface aliases keep working — fetch by interface for forward-compatible code. - Grid + Twig-hook configuration self-registers.
SetonoSyliusRedirectExtension::prepend()wiressylius_gridandsylius_twig_hooksautomatically — drop the oldimports:line for@SetonoSyliusRedirectPlugin/config/app/config.yaml. - Routes restructured. Replace
@SetonoSyliusRedirectPlugin/config/admin_routing.yamlwith@SetonoSyliusRedirectPlugin/config/routes.yaml. The new file already applies the/%sylius_admin.path_name%prefix; remove the explicitprefix:line.
New features
-
Config-driven automatic redirects on slug change. The "Add automatic redirect" checkbox on Product/Taxon admin forms is gone. Opt in per resource alias via the new config:
setono_sylius_redirect: automatic_redirects: sylius.product: true sylius.taxon: true
Defaults baked into every produced redirect:
permanent = true,only404 = true, no channel scope. Aliases must implementSylius\Component\Resource\Model\SlugAwareInterface. Extend coverage to your own resources by tagging a service withsetono_sylius_redirect.automatic_redirect_url_resolver. -
Toggle the always-on request listener (#113). New config option
setono_sylius_redirect.allow_non_404_redirects(defaulttrue). Set it tofalseif you only use 404-only redirects — the plugin stops registering itsKernelEvents::REQUESTlistener and the per-request DB query disappears. -
Memory-safe pruning. The
setono:sylius-redirect:removecommand was renamed tosetono:sylius-redirect:pruneand now iterates eligible redirects in batches viaocramius/doctrine-batch-utils. Pruning logic moved out of the repository into a dedicatedPrunerInterface. -
Friendlier admin form. Source/destination fields warn on duplicate sources via an AJAX check (
/admin/ajax/redirects/check-source) while you type, with a link to the conflicting redirect. The redirect grid gains filters forenabled,permanent,only404, andchannel.
Behavior changes
Redirect::$keepQueryStringdefault flipped fromfalse→true. If your fixtures, factories, or migrations rely on the old default, set the value explicitly.only404 = trueis the new automatic-redirect default. In 2.x the form-driven path usedfalse. Old slugs that still resolve no longer redirect, which self-heals if the slug is later rolled back.- Validators reworked. The single
Sourceconstraint split intoUniqueSource(global redirects) andUniqueSourcePerChannel(channel-scoped redirects). Translation keys updated accordingly — see UPGRADE.md.
Removed
A long list of classes, services, templates, and translation keys was removed in favor of cleaner replacements — full table in UPGRADE.md. The most notable: SlugUpdateHandler and friends (inlined into AutomaticRedirectListener), the Source / SourceRegex validators, the add_automatic_redirect form-extension stack, and RedirectInterface::onAccess() (renamed to markAsAccessed()).
Upgrade
Follow UPGRADE.md section-by-section. This is an alpha — please report issues at https://github.com/Setono/SyliusRedirectPlugin/issues so we can stabilize for the 3.0.0 release.
v2.7.0
v2.6.0
Added a check to see if the redirect results in a path that equals the current path. If so, it doesn't do anything and hence prevents an infinite loop. This problem could happen if you insert redirects in your own system and don't validate the redirect before inserting it.
Full Changelog: v2.5.0...v2.6.0
v2.5.0
v2.4.3
What's Changed
- Update messages.fr.yaml to have all translations by @maximehuran in #119
- Use sylius_admin.path_name in README to declare routes by @maximehuran in #118
New Contributors
- @maximehuran made their first contribution in #119
Full Changelog: v2.4.2...v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.0
What's Changed
- Add support for symfony/http-kernel "^6.0" by @JordiDekker in #110
New Contributors
- @JordiDekker made their first contribution in #110
Full Changelog: v2.2.0...v2.3.0