Skip to content

IBX-12046: Removed Symfony 8 deprecated code usage - #121

Open
ViniTou wants to merge 2 commits into
6.0from
ibx-12046-symfony-deprecations
Open

IBX-12046: Removed Symfony 8 deprecated code usage#121
ViniTou wants to merge 2 commits into
6.0from
ibx-12046-symfony-deprecations

Conversation

@ViniTou

@ViniTou ViniTou commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12046

Related PRs:

Description:

Removes usages of Symfony code paths that Symfony 8.0 drops, while staying on Symfony 7.4, so the repository no longer emits direct Symfony deprecation notices:

  • Validator\Constraints\Password relied on the base Symfony\Component\Validator\Constraint::__construct() options-array handling, which is deprecated since symfony/validator 7.4. Added a #[HasNamedArguments] constructor with named parameters (mirroring ibexa/core's UniqueIdentifier constraint), while keeping a BC options-array path that raises an ibexa/content-forms deprecation notice instead. UserAccountPassword inherits the fix without changes. FieldValue also extends Constraint but is never instantiated with an options array in this repo (or any other Ibexa repo, verified with a cross-repo grep), so it triggers no deprecation and was left untouched.
  • Content\View\Filter\ContentEditViewFilter used the deprecated Request::get(); replaced with an explicit attributesqueryrequest bag lookup, since the "validate" flag's origin (route attribute vs. query vs. submitted form field) isn't fixed.
  • Verified via cross-repo grep (admin-ui, user, form-builder, and all other ibexa/* repos) that Ibexa\ContentForms\Validator\Constraints\* is never referenced outside this repo, so no merge-order coordination is needed.

For QA:

  • Run this repo's unit and integration PHPUnit suites; both are green with 0 direct Symfony deprecations (previously 4 direct deprecations from the Password/UserAccountPassword constraints).
  • Exercise the content edit form's "validate" flag (draft vs. publish/validate submission) to confirm the ContentEditViewFilter behavior is unchanged.

Documentation:

Ibexa\ContentForms\Validator\Constraints\Password::__construct() (and inherited by UserAccountPassword) now accepts named arguments (contentType, message, groups, payload); passing an options array as the first argument still works but is deprecated.

- Validator\Constraints\Password: replaced getDefaultOption()-less
  positional-options constructor with named-argument constructor
  (#[HasNamedArguments]), keeping a deprecated options-array BC path
  (trigger_deprecation) for existing callers; UserAccountPassword
  inherits it unchanged.
- Content\View\Filter\ContentEditViewFilter: replaced deprecated
  Request::get() with an explicit attributes/query/request bag lookup.
Nothing in the platform sets this flag as a route attribute or form field; a query-string flag on the edit
URL is the only source, so the generic three-bag lookup inherited from Request::get() is dropped.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants