Skip to content

Commit

Permalink
Merge pull request #15610 from craftcms/bugfix/15545-validate-not-tem…
Browse files Browse the repository at this point in the history
…p-volume-adjustment

only validate visible fields
  • Loading branch information
brandonkelly authored Aug 28, 2024
2 parents 8af51bf + fadfc23 commit 668d08e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed a SQL error that occurred when running the `db/convert-charset` command if there were any custom database views or sequences. ([#15598](https://github.com/craftcms/cms/issues/15598))
- Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return `false` on databases that supported time zone conversion. ([#15592](https://github.com/craftcms/cms/issues/15592))
- Fixed a bug where Assets fields were validating settings that weren’t applicable depending on the “Restrict assets to a single location” setting. ([#15545](https://github.com/craftcms/cms/issues/15545))

## 4.11.5 - 2024-08-26

Expand Down
10 changes: 9 additions & 1 deletion src/fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,19 @@ protected function defineRules(): array
[
'sources',
'defaultUploadLocationSource',
'restrictedLocationSource',
'defaultUploadLocationSubpath',
],
'validateNotTempVolume',
'when' => fn() => !$this->restrictLocation,
];

$rules[] = [
[
'restrictedLocationSource',
'restrictedLocationSubpath',
],
'validateNotTempVolume',
'when' => fn() => $this->restrictLocation,
];

$rules[] = [['previewMode'], 'in', 'range' => [self::PREVIEW_MODE_FULL, self::PREVIEW_MODE_THUMBS], 'skipOnEmpty' => false];
Expand Down

0 comments on commit 668d08e

Please sign in to comment.