Problem/Motivation
Symfony 8 drops support for passing an array of options as an argumentto the base Constraint constructor. In Drupal 12, we can remove the $options argument to all the Drupal constraint classes.
Also, Symfony has deprecated the getDefaultOption() and getRequiredOptions() methods in
Symfony\Component\Validator\Constraint in 7.4 and removed in Symfony 8. Implementations of these methods in Drupal constraint classes should be removed in Drupal 12.
The below has been moved to #3569092: Update method signatures for addConstraint() and ConstraintManager::create() and remove HasNamedArguments use so that update to Symfony 8 can possibly be unblocked sooner.
The #[HasNamedArgument] attribute is also removed from Symfony 8, so that attribute and the BC layer in ConstraintManager/ConstraintFactory will need to be removed as well.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3569096
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3569096-12.x-remove-bc
changes, plain diff MR !15601
Comments
Comment #2
godotislateComment #3
godotislateComment #4
godotislateBringing over #3569093: [12.x] Remove getDefaultOption() and getRequiredOptions() methods in Drupal Constraint plugin classe here since it's trival.
Comment #6
godotislateMR is ready for review https://git.drupalcode.org/project/drupal/-/merge_requests/15601
Testing is code review + checking codebase that all Constraint classes don't have the $options parameter in the constructor.
Also no implementations of getDefaultOption and getRequiredOptions.
Comment #7
quietone commentedChanging to using tag instead of version number in the title.
Comment #8
smustgrave commentedApplied the MR (took forever with airplane internet) and applied and did search for "mixed $options = NULL," and "?string $prefix = NULL," with all hits being removed.
LGTM.
Comment #9
longwaveAdded a couple of review comments.
Comment #10
godotislateAddressed MR comments, back to NR.
Comment #11
smustgrave commentedBelieve feedback has been addressed. Correct me if I'm wrong.
Comment #13
longwaveCommitted and pushed 8447a07e0ee to main. Thanks!