This PR has been generated automatically.
For more details see
[upmerge_pr.yaml](/Sylius/Sylius/blob/2.3/.github/workflows/upmerge_pr.yaml).
**Remember!** The upmerge should always be merged with using `Merge pull
request` button.
In case of conflicts, please resolve them manually with usign the
following commands:
```
git fetch upstream
gh pr checkout <this-pr-number>
git merge upstream/symfony-8 -m "Resolve conflicts between 2.3 and symfony-8"
```
If you use other name for the upstream remote, please replace `upstream`
with the name of your remote pointing to the `Sylius/Sylius` repository.
Once the conflicts are resolved, please run `git merge --continue` and
push the changes to this PR.
| 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? | symfony-8
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Related tickets | https://github.com/Sylius/Sylius/pull/19064
| 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
-->
This PR has been generated automatically.
For more details see
[upmerge_pr.yaml](/Sylius/Sylius/blob/2.3/.github/workflows/upmerge_pr.yaml).
**Remember!** The upmerge should always be merged with using `Merge pull
request` button.
In case of conflicts, please resolve them manually with usign the
following commands:
```
git fetch upstream
gh pr checkout <this-pr-number>
git merge upstream/symfony-8 -m "Resolve conflicts between 2.3 and symfony-8"
```
If you use other name for the upstream remote, please replace `upstream`
with the name of your remote pointing to the `Sylius/Sylius` repository.
Once the conflicts are resolved, please run `git merge --continue` and
push the changes to this PR.
| 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)
DBAL 4.x has stricter type checking that doesn't accept DateTimeImmutable
in datetime fields. Until the codebase is fully compatible with DBAL 4.x,
we need to use DBAL 3.x for DoctrineBundle 2.x tests.
(cherry picked from commit 4abdd1c2a0)