Skip to content

Prevent destroying the default store - #6700

Merged
jarednorman merged 1 commit into
solidusio:v4.6from
SuperGoodSoft:backport-v4.6/prevent-default-store-destroy
Oct 17, 2026
Merged

jarednorman merged 1 commit into
solidusio:v4.6from
SuperGoodSoft:backport-v4.6/prevent-default-store-destroy

Conversation

@jarednorman

Copy link
Copy Markdown
Member

Summary

Spree::Store#validate_not_default ran as a before_destroy callback that added an error but never threw :abort, so the destroy went ahead and removed the default store. Prepend the callback so it runs before the dependent associations are destroyed and abort when the store is the default.

Backport of bfee596 and 94f3b84 from #6589.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

Spree::Store#validate_not_default ran as a before_destroy callback that
added an error but never threw :abort, so the destroy went ahead and
removed the default store. Prepend the callback so it runs before the
dependent associations are destroyed and abort when the store is the
default.

Backport of bfee596 and 94f3b84 from solidusio#6589.
@jarednorman
jarednorman requested a review from a team as a code owner October 16, 2026 07:25
@jarednorman jarednorman added the changelog:solidus_core Changes to the solidus_core gem label Oct 16, 2026
@jarednorman
jarednorman merged commit 62e9cb3 into solidusio:v4.6 Oct 17, 2026
37 checks passed
@jarednorman
jarednorman deleted the backport-v4.6/prevent-default-store-destroy branch October 17, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants