Skip to content

Commit

Permalink
Merge branch 'develop' into 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 14, 2024
2 parents 879d638 + 9259bb8 commit 8b1c7af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixed a bug where asset slideouts weren’t showing validation errors on the Filename field. ([#14329](https://github.com/craftcms/cms/issues/14329))
- Fixed a bug where element slideouts would open when long-pressing on an element’s “Remove” button within an element select input.
- Fixed a bug where relations weren’t getting deleted when an element was deleted for a site. ([#14347](https://github.com/craftcms/cms/issues/14347))
- Fixed a SQL error that occurred when saving a Number field with Decimals set to more than 30 on MySQL. ([#14370](https://github.com/craftcms/cms/issues/14370))

## 4.7.2.1 - 2024-02-08

Expand Down
5 changes: 5 additions & 0 deletions src/fields/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ protected function defineRules(): array
$rules = parent::defineRules();
$rules[] = [['defaultValue', 'min', 'max'], 'number'];
$rules[] = [['decimals', 'size'], 'integer'];

if ($this->decimals && Craft::$app->getDb()->getIsMysql()) {
$rules[] = [['decimals'], 'integer', 'max' => 30];
}

$rules[] = [
['max'],
'compare',
Expand Down

0 comments on commit 8b1c7af

Please sign in to comment.