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

Command icon 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:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

This MR adds the E_USER_DEPRECATED and also checks if $complex_data_constraint is set; without this check, modules like JSON Field will throw because they fail the check even though no complex data is actually set.

ptmkenny’s picture

Issue summary: View changes
quietone’s picture

godotislate’s picture

Status: Active » Needs review
Issue tags: +11.4.0 blocker
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems like a straight forward fix to me. Going to mark.

quietone’s picture

Title: @trigger_error() for the ComplexData deprecations omits E_USER_DEPRECATED, so E_USER_NOTICE is emitted » Some deprecation messages are missing E_USER_DEPRECATED
godotislate’s picture

Thanks 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.

  • godotislate committed 843061a2 on 11.x
    fix: #3599189 Some deprecation messages are missing E_USER_DEPRECATED...

  • godotislate committed 74dba219 on 11.4.x
    fix: #3599189 Some deprecation messages are missing E_USER_DEPRECATED...
godotislate’s picture

Status: Reviewed & tested by the community » Fixed

Committed 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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.