Registry Mirror
Skip to content

Conversation

@grandnode-dev

Copy link
Copy Markdown
Member

Type: bugfix

Issue

Every rule of DiscountRules.Standard (customer groups, had spent amount, shopping cart amount, has all products, has one product) threw ArgumentException when the discount of its configuration window could not be loaded, for example a discount deleted while its edit page was open, or an unknown id. The window showed a server error (500).

Solution

Configure (GET and POST) answers "Failed to load discount.", the same way it already answers "Failed to load requirement." for a rule that cannot be loaded. DiscountRulesHasOneProductController loses its GetDiscountAsync helper, which only existed to throw.

Breaking changes

None.

Testing

  • DiscountRuleControllerUnknownDiscountTests: GET and POST of all five rules with an unknown discount. Fails on develop (5 of 5), passes here.
  • Grand.Modules.Tests: 479 passed.

Every rule of DiscountRules.Standard threw ArgumentException when the discount of its configuration window could not be loaded (deleted meanwhile, or an unknown id), so the window showed a server error. It now answers "Failed to load discount.", as it already does for a rule that cannot be loaded.
Copilot AI balanced review requested due to automatic review settings November 28, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@grandnode-dev
grandnode-dev merged commit bd49dc0 into develop Nov 29, 2026
9 checks passed
@grandnode-dev
grandnode-dev deleted the fix/discount-rule-unknown-discount branch November 29, 2026 09:50
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.

2 participants