Skip to content

Conversation

@particleflux
Copy link
Contributor

The unique and exists validators behave slightly different since 2.0.46 (issue #19407) when used on multiple/combined attributes.

This adds a note about it in the UPGRADE guide

See: #19407 (comment)

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

The `unique` and `exists` validators behave slightly different since
2.0.46 (issue yiisoft#19407) when used on multiple/combined attributes.

See: yiisoft#19407 (comment)
@what-the-diff
Copy link

what-the-diff bot commented Aug 25, 2023

PR Summary

  • Update to Validation Error Reporting
    Previously, the UniqueValidator and ExistValidator in our code would generate separate errors for each attribute processed. Now, they will generate a single error even when used across multiple attributes. This can make identifying and resolving issues simpler and cleaner. However, if you preferred the old system, you can revert back by setting 'skipOnError' => false. Do note that this might cause unintended complications with additional validators on one of the target attributes. More details on this matter can be found in issue #19407.

  • Deprecation of 'rotateByCopy' Function In File Logging
    The rotateByCopy function in our file logging has been marked as deprecated and setting it to false will not affect the system. This change will streamline our logging process since henceforth files will be rotated only by copying. This uniform method should eliminate any inconsistencies and potential error points.

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4c0a00f) 48.91% compared to head (2c91716) 48.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19938   +/-   ##
=======================================
  Coverage   48.91%   48.91%           
=======================================
  Files         445      445           
  Lines       42810    42810           
=======================================
  Hits        20941    20941           
  Misses      21869    21869           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samdark samdark merged commit d5b3b6c into yiisoft:master Aug 26, 2023
@samdark
Copy link
Member

samdark commented Aug 26, 2023

Thank you!

@samdark samdark added this to the 2.0.49 milestone Aug 26, 2023
@samdark samdark added the type:docs Documentation label Aug 26, 2023
@particleflux particleflux deleted the changelog-note-about-validator-behavior-change branch August 26, 2023 08:42
@schmunk42
Copy link
Contributor

when used on multiple attributes, now only generate an error on a single attribute. Previously, they would report a separate error on each attribute.

@samdark @bizley @particleflux @xcopy Which attribute is picked for the error?

@particleflux
Copy link
Contributor Author

@schmunk42 In my case, it was the last one specified, though I'm not sure if that is always the case.

The errors on this comment is exactly what our test suite catched: it used to report both in order they were defined, but with newer version it only reported the last one only.

@bizley
Copy link
Member

bizley commented Aug 28, 2023

IIRC all attributes considered valid are picked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants