Skip to content

Releases: Setono/SyliusRedirectPlugin

3.0.0-alpha.2

04 May 09:13

Choose a tag to compare

3.0.0-alpha.2 Pre-release
Pre-release

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 (default true). Set it to false if you only use 404-only redirects — the plugin stops registering its KernelEvents::REQUEST listener, so the per-request database query disappears. The NotFoundSubscriber continues 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_redirects is false, the Only when 404 checkbox is dropped from the redirect admin form (new redirects keep the model default only404 = true), and a class-level constraint on Redirect rejects any save — form, API, CLI, fixtures — where only404 = false. This keeps the database from collecting redirects that would never fire.

    Pre-existing only404 = false rows go dormant when you flip the toggle off; flip it back, delete them, or update them to only404 = true to 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

04 May 08:55

Choose a tag to compare

v3.0.0-alpha Pre-release
Pre-release

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/*.xml files 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_path are 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() wires sylius_grid and sylius_twig_hooks automatically — drop the old imports: line for @SetonoSyliusRedirectPlugin/config/app/config.yaml.
  • Routes restructured. Replace @SetonoSyliusRedirectPlugin/config/admin_routing.yaml with @SetonoSyliusRedirectPlugin/config/routes.yaml. The new file already applies the /%sylius_admin.path_name% prefix; remove the explicit prefix: 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 implement Sylius\Component\Resource\Model\SlugAwareInterface. Extend coverage to your own resources by tagging a service with setono_sylius_redirect.automatic_redirect_url_resolver.

  • Toggle the always-on request listener (#113). New config option setono_sylius_redirect.allow_non_404_redirects (default true). Set it to false if you only use 404-only redirects — the plugin stops registering its KernelEvents::REQUEST listener and the per-request DB query disappears.

  • Memory-safe pruning. The setono:sylius-redirect:remove command was renamed to setono:sylius-redirect:prune and now iterates eligible redirects in batches via ocramius/doctrine-batch-utils. Pruning logic moved out of the repository into a dedicated PrunerInterface.

  • 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 for enabled, permanent, only404, and channel.

Behavior changes

  • Redirect::$keepQueryString default flipped from falsetrue. If your fixtures, factories, or migrations rely on the old default, set the value explicitly.
  • only404 = true is the new automatic-redirect default. In 2.x the form-driven path used false. Old slugs that still resolve no longer redirect, which self-heals if the slug is later rolled back.
  • Validators reworked. The single Source constraint split into UniqueSource (global redirects) and UniqueSourcePerChannel (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

12 May 11:46

Choose a tag to compare

Log infinite loops

Full Changelog: v2.6.0...v2.7.0

v2.6.0

12 May 11:25

Choose a tag to compare

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

05 Feb 11:40
b8394f2

Choose a tag to compare

What's Changed

  • Update league/uri and league/uri-components packages by @benbd5 in #121

New Contributors

Full Changelog: v2.4.3...v2.5.0

v2.4.3

04 Sep 11:27
3212aae

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.4.2...v2.4.3

v2.4.2

13 Dec 14:38

Choose a tag to compare

What's Changed

Full Changelog: v2.4.1...v2.4.2

v2.4.1

07 Aug 08:57
77e48e9

Choose a tag to compare

What's Changed

  • Do not throw if channel does not exist on current request by @lruozzi9 in #114

Full Changelog: v2.4.0...v2.4.1

v2.4.0

27 Mar 10:13
7e192b0

Choose a tag to compare

What's Changed

Full Changelog: v2.3.0...v2.4.0

v2.3.0

27 Mar 07:49
cffed86

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v2.2.0...v2.3.0