- πΊπΈUnited States smustgrave
Was previously tagged for tests in #6 which still needs to happen.
- πΈπͺSweden twod Sweden
+++ b/core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php @@ -83,7 +83,7 @@ public function form(array $form, FormStateInterface $form_state) { - if ($this->isCanonicalMode($this->entity->getMode())) { + if (TRUE || $this->isCanonicalMode($this->entity->getMode())) {
Leftover debug override?
- π·π΄Romania bbu23
hook_entity_view_mode_alter in combination with Layout Builder + a formatter set in the "new view mode" that contains an ajax form crashes. I've seen multiple issues related to layout builder and other view modes besides full. I've tried a combination of patches, including the one from here, but that does not fix my issue. A workaround for me is to have the formatter set in the "full" view mode as well.
Details:
1. I have a field formatter that displays an ajax form that whenever is submitted it reveals the processed value(s) of that field. But it requires this user interaction through ajax.
2. I have multiple "full" view modes that depend on specific entity values. So the "full" view mode is altered.
3. The ajax form does not work on the altered view modes, only on "full". It gives the "javascript is disabled" error which is described anyways in the ajax url documentation that it can happen.Workaround:
1. If the form is loaded earlier forcefully, without storing it or anything, just form builder load with any potential params, then the ajax form works.I feel like the solution for this lies in multiple issues combined. I doubt that anyone or maybe just a few people have this setup, but I wanted to share.
- π§πͺBelgium nightlife2008
I discovered a side effect of the patch in #16, namely that my theme is prematurely initialized, and the default theme is used instead of the admin theme, because the route match hasn't been determined yet at that point, since it's currently determining it :D
Steps in code when this happens:
1. Find route match for path
/layout_builder/add/block/overrides/node.391/0/<region>/<pluginId>
2. Routing parses the route params
3. Causes section storage's methodderiveContextsFromRoute
to be triggered
4. Rendering the entity causes the Theme negotiators to run on aNullRoute
, which at that point always returns the default theme.
5. The page is rendered in the default theme instead of using the admin_theme as it should according to the_admin_route: TRUE
flag. - π§πͺBelgium Tim Lammar
Rework of #16 with removal of first (I think debug?) change.
Tested on local D10.2.4. - Assigned to Tim Lammar