Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file uploader, test typed attributes #20167

Merged
merged 5 commits into from
May 30, 2024
Merged

Conversation

bizley
Copy link
Member

@bizley bizley commented May 26, 2024

Q A
Is bugfix? ✔️
New feature?
Breaks BC? ✔️ see below
Fixed issues #19855

Validator does not modify the attribute anymore - it was filtering out non-uploaded-files values from the array so far, but only for the array typed attributes with maxFiles != 1 or minFiles > 1.
Setting max files != 1 and sending empty array does not ends in error.

@bizley bizley marked this pull request as draft May 26, 2024 16:20
@bizley bizley marked this pull request as ready for review May 26, 2024 16:58
@bizley bizley requested review from a team and samdark May 26, 2024 16:58
Copy link

codecov bot commented May 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 13.51%. Comparing base (e1268d1) to head (1f618b6).

Current head 1f618b6 differs from pull request most recent head 7c5b213

Please upload reports for the commit 7c5b213 to get more accurate results.

Files Patch % Lines
framework/validators/FileValidator.php 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20167      +/-   ##
============================================
- Coverage     22.16%   13.51%   -8.66%     
+ Complexity    11386    11380       -6     
============================================
  Files           430      430              
  Lines         37113    37082      -31     
============================================
- Hits           8225     5010    -3215     
- Misses        28888    32072    +3184     

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

@samdark samdark added this to the 2.0.50 milestone May 27, 2024
@samdark
Copy link
Member

samdark commented May 28, 2024

Would you please add a line for CHANGELOG?

@samdark samdark merged commit e92466b into master May 30, 2024
143 of 166 checks passed
@samdark samdark deleted the 19855-file-validator-updates branch May 30, 2024 11:36
@samdark
Copy link
Member

samdark commented May 30, 2024

👍

} else {
$result = $this->validateValue($model->$attribute);
foreach ($files as $file) {
$result = $this->validateValue($file);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bizley validateValue() is now not called anymore when submitting an empty form, I created an issue with further details: #20231

samdark pushed a commit that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants