Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copying page with descendants to a different language #2243

Merged
merged 2 commits into from
Mar 1, 2022

Conversation

dbwinger
Copy link
Contributor

What is this pull request for?

When copying a page with children from one language to another, an ActiveRecord::RecordNotFound exception occurs.
If I understand this correctly, it's because the nested_set is scoped to the language here.

Closes #2101

Notable changes (remove if none)

Explicitly set the new parent_id on copied children. This allows nested set to operate in the scope of the new parent's language.

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

@dbwinger dbwinger mentioned this pull request Feb 28, 2022
3 tasks
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thank you

@tvdeyen tvdeyen merged commit be81154 into AlchemyCMS:main Mar 1, 2022
@dbwinger dbwinger deleted the copy-page-different-language branch April 1, 2022 12:48
dbwinger pushed a commit to dbwinger/alchemy_cms that referenced this pull request Jun 1, 2022
tvdeyen added a commit that referenced this pull request Jun 1, 2022
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.

Pasting a Page with children into different language tree fails with error
2 participants