Skip to content

Commit

Permalink
Fixed #3538
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Jun 11, 2024
1 parent a6af53c commit 08bce9d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for Craft Commerce

# Unreleased

- Fixed a PHP error that could occur when saving a discount. ([#3538](https://github.com/craftcms/commerce/issues/3538))

## 5.0.9 - 2024-06-05

- Product Title fields are no longer shown when “Show the Title field” is disabled and there’s a validation error on the `title` attribute. ([craftcms/cms#13876](https://github.com/craftcms/cms/issues/13876))
Expand Down
19 changes: 19 additions & 0 deletions src/elements/conditions/orders/DiscountOrderCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ class DiscountOrderCondition extends OrderCondition implements HasStoreInterface
{
use StoreTrait;

/**
* @inheritdoc
*/
protected function defineRules(): array
{
$rules = parent::defineRules();
$rules[] = [['storeId'], 'safe'];

return $rules;
}

/**
* @return array
*/
protected function config(): array
{
return array_merge(parent::config(), $this->toArray(['storeId']));
}

/**
* @inheritdoc
*/
Expand Down

0 comments on commit 08bce9d

Please sign in to comment.