- π·πΊRussia zniki.ru
I was able to replicate this on Drupal 10.2.
Thanks for detailed explanation, I want to add that you need to enable "Allow each content item to have its layout customized." option on Article manage display.This happens when you move block, and request to layout_builder.move_block route is made.
public function getArgument() { $value = NULL; // $this->options['entity_type_id'] is "node" in my case. if ($entity = $this->routeMatch->getParameter($this->options['entity_type_id'])) { } return $value; }
As you can see from the code for route layout_builder.move_block
getParameter('node')
will be null.
And if clause if FALSE, and getArgument returns NULL. That is the reason of this issue.In my case I have:
Node URL:/node/149/layout
When I move blocks
AJAX requestUri:/layout_builder/move/block/overrides/node.149/0/0/content/9e02ecfc-2654-4e95-b554-db1808cebb1e?_wrapper_format=drupal_ajax
So looks like section_storage is node.149.
I think you can get desired entity, but only as customization.
I don't know how this can be implemented in a contrib module as universal solution.Maybe someone have any ideas?
We need to find the way how to get original url, to get entity object.Not sure what status to set. Set it to Needs review for now.
- Merge request !10Draft: Issue #3236612: move block in layout builder preview β (Open) created by zniki.ru
- π·πΊRussia zniki.ru
I was able to find solution, not sure if I will merge it to code base.
But you can use it as patch.Please test it and provide feedback.