Skip to content

Restrict language destroy if nodes present#3383

Merged
tvdeyen merged 5 commits intomainfrom
restrict-language-destroy-if-nodes-present
Sep 29, 2025
Merged

Restrict language destroy if nodes present#3383
tvdeyen merged 5 commits intomainfrom
restrict-language-destroy-if-nodes-present

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Sep 29, 2025

What is this pull request for?

This dissallows to remove a language if menu nodes are still attached.

Also refactors existing checks into Rails built-ins by using dependent: :restrict_with_error
over a custom before_destroy hook.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 8.0 milestone Sep 29, 2025
@tvdeyen tvdeyen requested a review from a team as a code owner September 29, 2025 14:42
Rails has a this feature built in. Let's use it.
We must not allow to remove a language which is still
attached to a menu node.
Rails has a this feature built in. Let's use it.
Rails has a this feature built in. Let's use it.
Adding the i18n-debug gem, but disable it so it does
not clutter the logs. Enable it with `require: "i1n8/debug"`
@tvdeyen tvdeyen force-pushed the restrict-language-destroy-if-nodes-present branch from 2dd286f to 2d282fd Compare September 29, 2025 15:00
@tvdeyen tvdeyen enabled auto-merge September 29, 2025 15:00
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.99%. Comparing base (05c7da2) to head (2d282fd).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3383      +/-   ##
==========================================
- Coverage   97.00%   96.99%   -0.01%     
==========================================
  Files         277      277              
  Lines        7271     7262       -9     
==========================================
- Hits         7053     7044       -9     
  Misses        218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen tvdeyen merged commit 6afea50 into main Sep 29, 2025
18 checks passed
@tvdeyen tvdeyen deleted the restrict-language-destroy-if-nodes-present branch September 29, 2025 15:05
@alchemycms-bot alchemycms-bot bot mentioned this pull request Feb 4, 2026
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