Commit graph

40816 commits

Author SHA1 Message Date
TheMilek
0dba062dbf
[SF8] Fix interface signature changes 2026-06-19 13:14:33 +02:00
TheMilek
bff3428026
[SF8] Use named arguments for Validator constraint constructor 2026-06-19 13:14:33 +02:00
TheMilek
55fef698fb
Add build for symfony 8 supporting packages 2026-06-19 13:14:32 +02:00
TheMilek
bb18fbf814
Bump to Symfony 8 2026-06-19 13:14:32 +02:00
Grzegorz Sadowski
5e309dd2a1
[UPMERGE] 2.3 -> symfony-8 (#19076)
Some checks are pending
Continuous Integration (Minimal) / Static checks (push) Waiting to run
Continuous Integration (Minimal) / Tests (MariaDB) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Frontend (push) Blocked by required conditions
Continuous Integration (Minimal) / Packages (push) Blocked by required conditions
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.
2026-06-19 13:11:09 +02:00
Kamil Grygierzec
0a6bb24f47
Replace deprecated Request::get() with explicit request bags (#19074)
Some checks failed
Continuous Integration (Minimal) / Static checks (push) Has been cancelled
Continuous Integration (Minimal) / Tests (MariaDB) (push) Has been cancelled
Continuous Integration (Minimal) / Tests (MySQL) (push) Has been cancelled
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Has been cancelled
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Has been cancelled
Continuous Integration (Minimal) / Frontend (push) Has been cancelled
Continuous Integration (Minimal) / Packages (push) Has been cancelled
| 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 -->
2026-06-19 13:03:26 +02:00
TheMilek
6af1ad28dd
Replace undefined request->get with existing request->query->get 2026-06-19 12:45:59 +02:00
TheMilek
f447232bd2
Fix app.request in grid and breadcrumbs 2026-06-19 12:43:49 +02:00
TheMilek
999f15aedc
Fix app.request in templates 2026-06-19 12:43:49 +02:00
Grzegorz Sadowski
56cc7fabd3
[Payum] Revert PaymentSecurityToken to 2.3 BC version (#19073)
| 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
-->
2026-06-19 12:24:55 +02:00
Grzegorz Sadowski
79e41c8963
[Payum] Revert PaymentSecurityToken to 2.3 BC version 2026-06-19 12:03:59 +02:00
Grzegorz Sadowski
88b2a49867
[UPMERGE] 2.3 -> symfony-8 (#19069)
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.
2026-06-19 10:27:18 +02:00
Grzegorz Sadowski
b45835ad6a
Resolve conflicts between 2.3 and symfony-8 2026-06-19 08:50:52 +02:00
Jan Góralski
8b81264118
[Validator] Use named arguments in constraint constructors (#19066)
Some checks are pending
Continuous Integration (Minimal) / Static checks (push) Waiting to run
Continuous Integration (Minimal) / Tests (MariaDB) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Frontend (push) Blocked by required conditions
Continuous Integration (Minimal) / Packages (push) Blocked by required conditions
| 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 -->
2026-06-18 15:49:21 +02:00
Grzegorz Sadowski
8b4f03687e
[Validator] Move constraint properties above the constructor 2026-06-18 15:20:13 +02:00
Grzegorz Sadowski
e0ad785f8b
[Validator] Order constraint constructor arguments consistently 2026-06-18 15:16:41 +02:00
Grzegorz Sadowski
180de9d403
[Validator] Use constructor property promotion for constraint messages 2026-06-18 15:09:40 +02:00
Grzegorz Sadowski
1dcd199c39
[Validator] Rename constraint message options to consistent *Message convention 2026-06-18 14:05:37 +02:00
Grzegorz Sadowski
6a7a20f3e5
[ApiBundle] Restore configurable shippingAddressNotFoundMessage in ChosenShippingMethodEligibility 2026-06-18 14:05:28 +02:00
Grzegorz Sadowski
3e3409d423
[Maintenance] Add UPGRADE-2.3 notes for doctrine-bundle 3 and DBAL 4 2026-06-18 14:05:26 +02:00
Grzegorz Sadowski
5897846cbd
[Maintenance] Add UPGRADE-2.3 note about named arguments in validation constraints 2026-06-18 14:04:56 +02:00
Grzegorz Sadowski
a167cac1db
[Validator] Keep backward-compatible array options with a deprecation 2026-06-18 14:04:30 +02:00
Grzegorz Sadowski
e603a8c63e
[Attribute] Cast min/max to int in Text and Select attribute validation 2026-06-18 14:04:29 +02:00
Grzegorz Sadowski
da25e534a8
[Validator] Cover remaining constraints with named arguments 2026-06-18 14:04:29 +02:00
TheMilek
1c4f891a8c
Fix validation constraints
(cherry picked from commit 4c92845830)
2026-06-18 14:04:29 +02:00
TheMilek
d8b1554952
[SF8] Use named arguments for Validator constraint constructor
(cherry picked from commit 2dbad7b21e)
2026-06-18 14:04:29 +02:00
Jan Góralski
f745ee5aa0
Allow doctrine/doctrine-bundle ^3.0 and doctrine/dbal ^4.0 (#19064)
Some checks are pending
Continuous Integration (Minimal) / Static checks (push) Waiting to run
Continuous Integration (Minimal) / Tests (MariaDB) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Javascript Tests (MySQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Tests (PostgreSQL) (push) Blocked by required conditions
Continuous Integration (Minimal) / Frontend (push) Blocked by required conditions
Continuous Integration (Minimal) / Packages (push) Blocked by required conditions
| 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 -->
2026-06-18 10:56:49 +02:00
Grzegorz Sadowski
8432f8edb4
[CoreBundle] Centralize all DQL platform checks in PlatformHelper 2026-06-18 10:09:06 +02:00
Grzegorz Sadowski
694c40d7ed
Document removed Doctrine cache provider services in UPGRADE-2.3 2026-06-18 06:51:30 +02:00
Grzegorz Sadowski
acc20b277a
Centralize SQLite platform detection, simplify platform name match, use LogicException 2026-06-18 06:26:24 +02:00
Grzegorz Sadowski
1ab6228718
[CoreBundle] Fix AtomicOrderPromotionsUsageModifier test for DBAL 4 LockMode enum 2026-06-18 06:16:31 +02:00
Grzegorz Sadowski
6dc94c9485
Update symfony.lock 2026-06-18 06:16:30 +02:00
Grzegorz Sadowski
8ff49b1faf
[Maintenance] Add UPGRADE-2.3 notes for doctrine-bundle 3 and DBAL 4 2026-06-18 06:16:28 +02:00
Grzegorz Sadowski
209016df32
[Payum] Preserve PaymentSecurityToken BC (revert details to untyped, use custom ObjectType) 2026-06-17 14:33:45 +02:00
TheMilek
3aad5d6fd7
Test doctrinebundle combinations
(cherry picked from commit 408a6bde4d)
2026-06-17 14:33:45 +02:00
TheMilek
5ded5aaff3
Make clock datetimeimmutable compatible with datetime type in mapping
(cherry picked from commit c1f02dd633)
2026-06-17 14:33:45 +02:00
TheMilek
03bd383c9f
Add custom ObjectType for DBAL 4.x compatibility
(cherry picked from commit 2e7d903606)
2026-06-17 14:33:45 +02:00
TheMilek
c976028ee7
Make test mocks compatible with DBAL 3 and 4
(cherry picked from commit e264fac021)
2026-06-17 14:33:44 +02:00
Rafikooo
bd364048bb
Fix DBAL 4.x mock compatibility in tests
- Update DriverMock::connect() signature for DBAL 4.x
- Add return types to DriverConnectionMock methods
- Add return types to StatementMock methods
- Add return types to DatabasePlatformMock methods

(cherry picked from commit 1c9cd7c243)
2026-06-17 14:33:44 +02:00
Rafikooo
c9c81f4b60
Fix DateTime to DateTimeImmutable for DBAL 4.x compatibility
- 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)
2026-06-17 14:33:44 +02:00
Rafikooo
b8a6b7442b
Fix fixture factories for datetime_immutable DBAL type
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)
2026-06-17 14:33:44 +02:00
Rafikooo
97c4a2ebb1
Fix DateTimeImmutable::sub() - assign return value
(cherry picked from commit 39c687ed0e)
2026-06-17 14:33:44 +02:00
Rafikooo
f92ec2b52b
Use DateTimeImmutable in model constructors for DBAL 4.x compatibility
(cherry picked from commit bbb6d00e2f)
2026-06-17 14:33:44 +02:00
Rafikooo
07409b4b80
Use PSR-6 cache pools directly for ORM 3.x compatibility
(cherry picked from commit 8fd759784a)
2026-06-17 14:33:43 +02:00
Rafikooo
d2b81c09cb
Align data-fixtures version in AddressingBundle
(cherry picked from commit 4bc86730f8)
2026-06-17 14:33:43 +02:00
Rafikooo
f2c28b746f
Allow doctrine/data-fixtures ^2.2 for persistence ^4 support
(cherry picked from commit 3102ec010c)
2026-06-17 14:33:43 +02:00
Rafikooo
84f6b4eedc
Use datetime_immutable Doctrine type for DBAL 4.x compatibility
(cherry picked from commit 07130603b1)
2026-06-17 14:33:43 +02:00
Rafikooo
6c30d0cf6e
Align doctrine-bundle version in bundle composer.json files
(cherry picked from commit 8861205149)
2026-06-17 14:33:43 +02:00
Rafikooo
e204f6a602
Move DBAL 3.x/4.x compatibility ignore to global phpstan config
(cherry picked from commit 2c61ba6353)
2026-06-17 14:33:43 +02:00
Rafikooo
c97ce1af28
Force DBAL 3.x for DoctrineBundle 2.x tests
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)
2026-06-17 14:33:43 +02:00