Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294952

Overwrite Symfony constraint errors in constructors instead of properties

$
0
0

Problem/Motivation

Discovered in #3394694: [Meta] Symfony 7 compatibility and #3425150: Symfony deprecations in Constraint plugins and already handled for one case in #3276196: The "Symfony\Component\Validator\Constraints\Range::$minMessage" property is considered final, Symfony considers public and protected class properties to be final. Validator constraint messages are declared as properties and where we need to override these (usually because we change the way they are formatted) we have done it by redeclaring the properties.

Steps to reproduce

https://git.drupalcode.org/issue/drupal-3394694/-/jobs/990299

Look for "Property ...Constraint... overriding property ... should also have native type ..."

Proposed resolution

Switch AllowedValuesConstraint, CountConstraint, LengthConstraint and RegexConstraint to use the constructor technique used in RangeConstraint from #3276196: The "Symfony\Component\Validator\Constraints\Range::$minMessage" property is considered final.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>