[Validator] Add BC layer for notInRangeMessage when min and max are set#36140
[Validator] Add BC layer for notInRangeMessage when min and max are set#36140fabpot merged 1 commit intosymfony:4.4from
Conversation
|
Also see #33700 I also noticed that and back then we decided to document this small behavior change. |
2d50ed1 to
f12794e
Compare
src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php
Outdated
Show resolved
Hide resolved
d8f0c3f to
1136014
Compare
|
Adding a BC layer on a maintenance branch feels wrong to me, you shouldn't get new deprecation notices in a patch release. The BC break should either be reverted or documented instead. |
1136014 to
dc9a366
Compare
dc9a366 to
092d85c
Compare
Reverting would mean breaking BC on 5.0 - Documenting is what this PR is about. Note that I didn't get the patch so I'm just commenting on the process :) |
|
@l-vo What's the status here? |
|
@fabpot from my point of view the fix itself is finished, the blocking point is more a discussion between contributors/core members about what should be done here. |
|
Thank you @l-vo. |
|
@l-vo I've merge 4.4 into 5.1, can you create a PR for 5.1 where you remove the BC layer? |
|
Of course, I'm AFAK today but I'm doing it tomorrow. |
This PR was merged into the 4.4 branch. Discussion ---------- [Validator] RangeTest: fix expected deprecation | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | #36140 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | N/A Fixes https://travis-ci.org/github/symfony/symfony/jobs/717184009#L5830-L5831 Commits ------- 33c8c3a [Validator] RangeTest: fix expected deprecation
|
@fabpot Do we really want to remove the BC layer in 5.x ? In the early 5.0 and 5.1 versions, the behavior of |
|
@l-vo Right, let's remove it for 6.0. |
According to #36133, the improvement added in #32435 may lead to a BC break when the developer pass
minandmaxoptions and a customminMessageormaxMessage. In this case it's expected to receive aminMessage/maxMessagein the violation but anotInRangeMessageis received instead.So in the following conditions:
minandmaxoptions are setminMessageormaxMessageis setA deprecation is triggered. If a limit is violated and matches to the min/max message passed as option (
minMessageforminviolated andmaxMessageformaxviolated),minMessage/maxMessageis used in the violation instead ofnotInRangeMessage.