| Q | A
|-----------------|-----
| Branch? | 2.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Related tickets | none
| License | MIT
This PR removes the dependency of `PayumPayResponseProvider` on
`RequestConfiguration` (from `Sylius\Bundle\ResourceBundle\Controller`)
to retrieve the after-pay redirect route.
Previously, the redirect route used to build the Payum capture/authorize
token was read at runtime from the `_sylius` routing metadata via
`$requestConfiguration->getParameters()->get('redirect')`. This approach
was coupled to the ResourceBundle routing convention and required the
route definition to carry this information through the request
lifecycle.
---
### Changes
**`PayumPayResponseProvider`**
- Added two constructor parameters: `?string $afterPayUrlRoute` and
`array $afterPayUrlParameters`, injected at compile time.
- Removed the dynamic reading of
`$requestConfiguration->getParameters()->get('redirect')` at runtime.
- Simplified `provideTokenBasedOnPayment()` to use the injected
parameters directly, eliminating its `$redirectOptions` argument.
**`ShopBundle` configuration** (`Configuration.php`)
- Added two new `order_pay` configuration keys dedicated to Payum:
`payum_after_pay_route` (default: `sylius_shop_order_after_pay`) and
`payum_after_pay_route_parameters` (default: `[]`).
- These are intentionally separate from the existing `after_pay_route`
and `after_pay_route_parameters` keys, which are reserved for the
Payment Request flow and carry Payment Request-specific defaults (e.g.
`hash: paymentRequest.getHash()`).
**`ShopBundle` extension** (`SyliusShopExtension.php`)
- Exposes `%sylius_shop.order_pay.payum_after_pay_route%` and
`%sylius_shop.order_pay.payum_after_pay_route_parameters%` as container
parameters.
**`PayumBundle` service definition**
(`integrations/sylius_shop/order_pay/providers.php`)
- The `sylius_shop.provider.order_pay.pay_response.payum` service now
explicitly injects `%sylius_shop.order_pay.payum_after_pay_route%` and
`%sylius_shop.order_pay.payum_after_pay_route_parameters%` as
constructor arguments.
**`ShopBundle` routing** (`order.yml`)
- Removed the `_sylius.redirect` block from the `sylius_shop_order_pay`
route, which is no longer needed since the redirect route is now
resolved through the container parameter.
**`UPGRADE-2.3.md`**
- Documented the routing change and the migration path for projects that
customized the after-pay redirect route via the `_sylius` routing
metadata.
---
### Motivation
- Decouples `PayumPayResponseProvider` from the ResourceBundle
controller infrastructure (`RequestConfiguration`).
- Makes the after-pay redirect route an explicit, inspectable, and
overridable service configuration rather than an implicit routing
convention.
- Aligns with the ongoing effort to reduce reliance on
`Sylius\Bundle\ResourceBundle\Controller` in the PaymentRequest feature.
---
### Backward Compatibility
> ⚠️ The `_sylius: redirect:` block on `sylius_shop_order_pay` is
removed from the routing. Projects that relied on overriding this
routing parameter to customize the Payum after-pay redirect route should
now use the dedicated `sylius_shop` bundle configuration keys instead:
>
> ```yaml
> sylius_shop:
> order_pay:
> payum_after_pay_route: sylius_shop_order_after_pay
> payum_after_pay_route_parameters: []
> ```
>
> Note: `after_pay_route` and `after_pay_route_parameters` are reserved
for the Payment Request flow and should not be used to configure the
Payum redirect.
>
> See `UPGRADE-2.3.md` for details.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a migration note explaining that Payum after-pay redirects no
longer rely on `_sylius: redirect:` routing metadata and how to
configure the replacement options.
* **New Features**
* Introduced `sylius_shop.order_pay.payum_after_pay_route` and
`sylius_shop.order_pay.payum_after_pay_route_parameters` to customize
the Payum after-pay redirect target and parameters.
* **Refactor**
* Removed the automatic redirect from `sylius_shop_order_pay`; Payum
after-pay redirect is now driven by the new configuration.
* **Tests**
* Added/updated PHPUnit coverage for the new configuration defaults and
Payum after-pay redirect behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
| Q | A
|-----------------|-----
| Branch? | 2.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Related tickets |
| License | MIT
<!--
- Bug fixes must be submitted against the 2.2 branch
- Features and deprecations must be submitted against the 2.3 branch
- Make sure that the correct base branch is set
To be sure you are not breaking any Backward Compatibilities, check the
documentation:
https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
| Q | A
|-----------------|-----
| Branch? | 2.3 <!-- see the comment below -->
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no <!-- don't forget to update the UPGRADE-*.md file
-->
| License | MIT
<!--
- Bug fixes must be submitted against the 2.2 branch
- Features and deprecations must be submitted against the 2.3 branch
- Make sure that the correct base branch is set
To be sure you are not breaking any Backward Compatibilities, check the
documentation:
https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
| Q | A
|-----------------|-----
| Branch? | 2.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Related tickets | extracted from
https://github.com/Sylius/Sylius/pull/18803
| License | MIT
Replaces deprecated `Request::get()` calls with explicit request bags
across templates, the shop product grid and the Payum AfterPay provider.
<!--
- Bug fixes must be submitted against the 2.2 branch
- Features and deprecations must be submitted against the 2.3 branch
- Make sure that the correct base branch is set
To be sure you are not breaking any Backward Compatibilities, check the
documentation:
https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **Bug Fixes**
* Fixed payment request breadcrumb navigation
* Fixed product taxon position update functionality
* Fixed payment response handling
* Fixed product grid sorting behavior
* Fixed product review creation links
* Fixed route identification in page layouts
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
| Q | A
|-----------------|-----
| Branch? | 2.3
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Related tickets | partially #9693, extracted from
https://github.com/Sylius/Sylius/pull/18803
| License | MIT
Gives all Sylius validation constraints explicit constructors with named
arguments (marked with `#[HasNamedArguments]`) that initialize their
properties themselves, instead of relying on the base `Constraint` class
to evaluate an array of options (evaluating options in
`Constraint::__construct()` is deprecated since Symfony 7.4 and removed
in Symfony 8).
To avoid a BC break, the legacy array-options syntax is **kept working**
as a backward-compatibility layer (a leading `?array $options` argument)
and now triggers a **deprecation** instead of failing. It will be
removed in Sylius 3.0.
As a result:
- It works on all supported Symfony versions (6.4, 7.4 and 8.0).
- Configuring constraints via XML / YAML / PHP attributes is **not
affected** - the validator loaders pass options as named arguments
automatically (no deprecation).
- Only **direct PHP instantiation** using the array syntax (`new
SomeConstraint(['message' => '...'])`) emits a deprecation; switch to
named arguments (`new SomeConstraint(message: '...')`).
Most of the constructor changes are cherry-picked from the `symfony-8`
branch (PR #18803) and adapted to preserve backward compatibility with
the deprecation layer. On top of that, this PR also covers several
remaining constraints with configurable options that were missed there.
Documented in `UPGRADE-2.3.md`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
# Release Notes
* **New Features**
* Added Symfony validator named-arguments support across many constraint
classes for clearer configuration.
* **Deprecated**
* Array-based constraint configuration is deprecated (removal planned
for Sylius 3.0); use named arguments instead.
* Constraint message option/property names have been normalized to
`*Message` variants; legacy names remain temporarily but are deprecated.
* **Bug Fixes**
* Validator violation messages now consistently use the new `*Message`
properties.
* **Documentation**
* Updated upgrade guide with migration examples and the message option
rename mapping.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
| Q | A
|-----------------|-----
| Branch? | 2.3
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file
-->
| Related tickets | duplicates
https://github.com/Sylius/Sylius/pull/18754, partially
https://github.com/Sylius/Sylius/issues/18760
| License | MIT
This PR is a duplication of #18754 (which targets the `symfony-8`
branch). It reuses that PR's commits to bring the broadened Doctrine
support into `2.3`.
### What it does
Widens the supported Doctrine stack, **opt-in via `||`, no minimum is
bumped**:
- `doctrine/doctrine-bundle` `^2.13 || ^3.0`
- `doctrine/dbal` `^3.9 || ^4.0`
- `doctrine/persistence` `^3.3 || ^4.0`
- `doctrine/data-fixtures` `^1.7 || ^2.2` (dev)
Plus the compatibility work the newer stack requires:
- DBAL 3.x/4.x compatibility layers (platform detection,
`getSchemaManager()` → `createSchemaManager()`,
`SqlitePlatform`/`SQLitePlatform`, `QueryBuilder::select()`);
- a custom `ObjectType` registered as `object` (the built-in `object`
type was removed in DBAL 4),
covering the only two `type="object"` mappings:
`PaymentSecurityToken.details` and `PaymentRequest.payload`;
- config updates: removed `auto_generate_proxy_classes` (gone in
DoctrineBundle 3), PSR-6 cache pools,
and forced `SEQUENCE` identity generation on PostgreSQL to keep the
schema backward compatible;
- CI matrix entries to test both DoctrineBundle 2 and 3.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added support for DoctrineBundle 3 and DBAL 4.
* Added a custom DBAL “object” type to keep payment data compatible.
* **Documentation**
* Added Sylius 2.3 upgrade notes, including Doctrine cache pool
migration and PostgreSQL identity/sequence behavior.
* **Bug Fixes**
* Updated Doctrine ORM cache configuration to use Symfony cache pools
(production and test setups).
* Fixed timestamp handling to consistently store mutable `DateTime`
values where required.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Use ClockInterface in UserLastLoginSubscriber instead of new DateTime()
- Update all test fixtures to use DateTimeImmutable
- Fix test code using DateTime for entity properties
(cherry picked from commit a01e7ef1eb)
DBAL 4.x strictly requires DateTimeImmutable for datetime_immutable
columns. This fixes:
- Fixture factories to use DateTimeImmutable::createFromMutable() for Faker dates
- AddressLogEntry to override Gedmo's setLoggedAt() with DateTimeImmutable
(cherry picked from commit 5d8fd73280)