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

Pasting a Page with children into different language tree fails with error #2101

Closed
robinboening opened this issue May 17, 2021 · 1 comment · Fixed by #2243
Closed

Pasting a Page with children into different language tree fails with error #2101

robinboening opened this issue May 17, 2021 · 1 comment · Fixed by #2243

Comments

@robinboening
Copy link
Contributor

robinboening commented May 17, 2021

Steps to reproduce

  1. Copy a Page with children.
  2. Switch to another language.
  3. Click create new Page
  4. Choose the previously copied Page from the "Paste from clipboard" tab.

Expected behavior

It should create the Page including the child pages in the language tree.

Actual behavior

It throws an error; after reloading the browser I can see the parent Page got created without its children.

Couldn't find Alchemy::Page with [WHERE "alchemy_pages"."layoutpage" = $1 AND "alchemy_pages"."language_id" = $2 AND "alchemy_pages"."id" = $3]

Stacktrace

E, [2021-05-17T11:27:12.236524 #4] ERROR -- : [602baf77-09dd-4c9a-a1db-0aa7acf3330f] ActiveRecord::RecordNotFound Couldn't find Alchemy::Page with [WHERE "alchemy_pages"."layoutpage" = $1 AND "alchemy_pages"."language_id" = $2 AND "alchemy_pages"."id" = $3] in ../active_record/relation/finder_methods.rb:354:in `raise_record_not_found_exception!'
E, [2021-05-17T11:27:12.236866 #4] ERROR -- : [602baf77-09dd-4c9a-a1db-0aa7acf3330f] ../active_record/relation/finder_methods.rb:129:in `first!'
../lib/awesome_nested_set/model.rb:274:in `reload_target'
../lib/awesome_nested_set/model/movable.rb:104:in `block (2 levels) in move_to'
../active_record/connection_adapters/abstract/database_statements.rb:318:in `transaction'
../active_record/transactions.rb:209:in `transaction'
../active_record/transactions.rb:290:in `transaction'
../lib/awesome_nested_set/model/transactable.rb:16:in `in_tenacious_transaction'
../lib/awesome_nested_set/model/movable.rb:103:in `block in move_to'
../lib/active_support/callbacks.rb:106:in `run_callbacks'
../lib/awesome_nested_set/model/movable.rb:102:in `move_to'
../lib/awesome_nested_set/model/movable.rb:39:in `move_to_child_of'
../lib/awesome_nested_set/model/movable.rb:126:in `move_to_new_parent'
../lib/active_support/callbacks.rb:427:in `block in make_lambda'
../lib/active_support/callbacks.rb:235:in `block in halting_and_conditional'
../lib/active_support/callbacks.rb:516:in `block in invoke_after'
../lib/active_support/callbacks.rb:516:in `each'
../lib/active_support/callbacks.rb:516:in `invoke_after'
../lib/active_support/callbacks.rb:131:in `block in run_callbacks'
../lib/active_support/callbacks.rb:137:in `run_callbacks'
../lib/active_support/callbacks.rb:824:in `_run_save_callbacks'
../active_record/callbacks.rb:457:in `create_or_update'
../active_record/timestamp.rb:126:in `create_or_update'
../active_record/persistence.rb:507:in `save!'
../active_record/validations.rb:53:in `save!'
../active_record/transactions.rb:302:in `block in save!'
../active_record/transactions.rb:354:in `block in with_transaction_returning_status'

System configuration

  • Alchemy Version: main branch
  • Rails Version: rails 6.0
@tvdeyen
Copy link
Member

tvdeyen commented Jun 25, 2021

Thanks. This needs to be fixed. Probably because of the page versions refactoring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants