Problem/Motivation
Testing 11.4.0-rc1, it seems #3555534: Since symfony/validator 7.4: Support for evaluating options in the base Constraint class is deprecated. Initialize properties in the constructor instead. broke feeds imports with JSON Field module as described in #3598615: 11.4: Constraint plugins must use named arguments (ComplexData).
I tried to fix this in JSON Field but could not. Analysis with claude identified that the trigger-error calls in #3555534 omit E_USER_DEPRECATED, so they get rethrown and break Feeds.
Proposed resolution
Add E_USER_DEPRECATED to trigger_error().
This is specific to 11.x because main/12.x already have #3569096: Remove BC layer $options argument from Constraint plugin constructors
Issue fork drupal-3599189
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:
- trigger_error_deprecation
changes, plain diff MR !16040
Comments
Comment #3
ptmkenny commentedThis MR adds the E_USER_DEPRECATED and also checks if
$complex_data_constraintis set; without this check, modules like JSON Field will throw because they fail the check even though no complex data is actually set.Comment #4
ptmkenny commentedComment #5
quietone commentedComment #6
godotislateComment #7
smustgrave commentedSeems like a straight forward fix to me. Going to mark.
Comment #8
quietone commentedComment #9
godotislateThanks for working on this. I think we did notice the issue with BaseFieldDefinition and FieldConfigBase when removing the deprecations in #3571065: Remove deprecated code from lib/Entity and lib/Field and even discussed in Slack, but I think we forgot to open a follow up for 11.x.
Comment #13
godotislateCommitted and pushed 843061a to 11.x and 74dba21 to 11.4.x. Thanks!
Edit: Consulted with other RMs about committing to 11.4, got no objections.