Problem/Motivation

A 2.0.x branch has been created, there's known test failures that will need some time to figure out.

Steps to reproduce

Run the pipeline and see the errors.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

N/A

CommentFileSizeAuthor
#9 errors.patch1.51 KBheddn
#2 layout_builder_st-usage.png37.85 KBjoseph.olstad
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

StatusFileSize
new37.85 KB

Possible lead to a fix.

Steps to reproduce:

  1. Fresh install of Drupal 10.4.6
  2. Set french as original language (site default language)
  3. Add english as a second language option
  4. configure language negotiation using a two letter prefix
  5. install layout_builder_st
  6. configure a bundle like article or basic page to have translation enabled
  7. create a node, then try to edit the layout on one node in english (the second language)

Exception occurs

- edit the layout on the same node using french (the original/site default language), no error , able to edit the layout without exception.

see screenshot:
screenshot

exception message follows: (from core)

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Component\Utility\UrlHelper::buildQuery(): Argument #1 ($query) must be of type array, null given, called in /docroot/html/core/modules/contextual/contextual.module on line 178 in Drupal\Component\Utility\UrlHelper::buildQuery() (line 42 of core/lib/Drupal/Component/Utility/UrlHelper.php).
joseph.olstad’s picture

My guess is, something in core changed between Drupal 9.5 through to Drupal 10.4 / Drupal 11.1 causing this exception to be thrown.

Actually, looks like some deprecation that was removed in PHP 8+ causing the exception. PHP 7.4 with Drupal 9.5 would not have crashed here.

Full stack trace of two possibly related errors.

Url: /en/node/2277/layout

Warning : Undefined array key "route_parameters" dans _contextual_links_to_id() (/docroot/html/core/modules/contextual/contextual.module ligne 178)
#0 /docroot/html/core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 /docroot/html/core/modules/contextual/contextual.module(178): _drupal_error_handler()
#2 /docroot/html/core/modules/contextual/contextual.module(136): _contextual_links_to_id()
#3 [internal function]: contextual_preprocess()
#4 /docroot/html/core/lib/Drupal/Core/Theme/ThemeManager.php(267): call_user_func_array()
#5 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#6 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#7 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#8 /docroot/html/core/lib/Drupal/Core/Template/TwigExtension.php(484): Drupal\Core\Render\Renderer->render()
#9 /docroot/vendor/twig/twig/src/Environment.php(421) : eval()'d code(63): Drupal\Core\Template\TwigExtension->escapeFilter()
#10 /docroot/vendor/twig/twig/src/Template.php(388): __TwigTemplate_d67f3ad1b40b574808b1908123cef76b->doDisplay()
#11 /docroot/vendor/twig/twig/src/Template.php(344): Twig\Template->yield()
#12 /docroot/vendor/twig/twig/src/Template.php(359): Twig\Template->display()
#13 /docroot/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render()
#14 /docroot/html/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render()
#15 /docroot/html/core/lib/Drupal/Core/Theme/ThemeManager.php(354): twig_render_template()
#16 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#17 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#18 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#19 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#20 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#21 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#22 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render()
#23 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#24 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(231): Drupal\Core\Render\Renderer->executeInRenderContext()
#25 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#26 /docroot/html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#27 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#28 /docroot/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#29 /docroot/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#30 /docroot/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#31 /docroot/html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#32 /docroot/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#33 /docroot/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#34 /docroot/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#35 /docroot/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#36 /docroot/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#37 /docroot/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#38 /docroot/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#39 /docroot/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#40 /docroot/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#41 /docroot/html/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#42 /docroot/html/index.php(19): Drupal\Core\DrupalKernel->handle()
#43 {main}

Second error:

Url: /en/node/2277/layout

#0 /docroot/html/core/modules/contextual/contextual.module(178): Drupal\Component\Utility\UrlHelper::buildQuery()
#1 /docroot/html/core/modules/contextual/contextual.module(136): _contextual_links_to_id()
#2 [internal function]: contextual_preprocess()
#3 /docroot/html/core/lib/Drupal/Core/Theme/ThemeManager.php(267): call_user_func_array()
#4 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#5 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#6 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#7 /docroot/html/core/lib/Drupal/Core/Template/TwigExtension.php(484): Drupal\Core\Render\Renderer->render()
#8 /docroot/vendor/twig/twig/src/Environment.php(421) : eval()'d code(63): Drupal\Core\Template\TwigExtension->escapeFilter()
#9 /docroot/vendor/twig/twig/src/Template.php(388): __TwigTemplate_d67f3ad1b40b574808b1908123cef76b->doDisplay()
#10 /docroot/vendor/twig/twig/src/Template.php(344): Twig\Template->yield()
#11 /docroot/vendor/twig/twig/src/Template.php(359): Twig\Template->display()
#12 /docroot/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render()
#13 /docroot/html/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render()
#14 /docroot/html/core/lib/Drupal/Core/Theme/ThemeManager.php(354): twig_render_template()
#15 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render()
#16 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#17 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#18 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#19 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender()
#20 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender()
#21 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(238): Drupal\Core\Render\Renderer->render()
#22 /docroot/html/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#23 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(231): Drupal\Core\Render\Renderer->executeInRenderContext()
#24 /docroot/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#25 /docroot/html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#26 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#27 /docroot/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#28 /docroot/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#29 /docroot/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#30 /docroot/html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#31 /docroot/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#32 /docroot/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#33 /docroot/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#34 /docroot/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#35 /docroot/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass()
#36 /docroot/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#37 /docroot/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#38 /docroot/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#39 /docroot/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#40 /docroot/html/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#41 /docroot/html/index.php(19): Drupal\Core\DrupalKernel->handle()
#42 {main}
joseph.olstad’s picture

liam morland made their first commit to this issue’s fork.

heddn made their first commit to this issue’s fork.

heddn’s picture

The easy fix was to pull in #3411037: Contextual links for translation are removed by core. However, I'm fully convinced that one of

are being faced. In TranslateBlockForm::createTranslationElement, we interact with TypedData and that triggers validations of TypedConfigManager plugins in TypedDataManager. I'm not sure how to solve this. For now posting my findings.

You too can reproduce this on a 10.4 or later site and this module.

drush en -y content_translation layout_builder_st field_ui

  1. Add a second language: admin/config/regional/language/add
  2. Enable translations for Content => Basic page content type: admin/config/regional/content-language
  3. Configure view display to use layout builder and have customized displays: admin/structure/types/manage/page/display
  4. Add a node and translate it: node/add/page & node/1/translations
  5. Attempt to edit any of the layout blocks via contextual links on the translation node/1/layout
heddn’s picture

StatusFileSize
new1.51 KB

If you patch core with the attached test, something between 10.2.0 and 10.3.0 broke. This is the logic that lb_st is trying to do.

index a7048f38eef..d9438019a39 100644
--- a/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
+++ b/core/tests/Drupal/KernelTests/Core/TypedData/TypedDataTest.php
@@ -9,6 +9,7 @@
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\ListDataDefinition;
 use Drupal\Core\TypedData\MapDataDefinition;
+use Drupal\Core\TypedData\Plugin\DataType\StringData;
 use Drupal\Core\TypedData\Type\BinaryInterface;
 use Drupal\Core\TypedData\Type\BooleanInterface;
 use Drupal\Core\TypedData\Type\DateTimeInterface;
@@ -697,4 +698,24 @@ public function testTypedDataValidation(): void {
     $this->assertSame('0.value', $violations[0]->getPropertyPath());
   }
 
+  public function testTypedDataGet(): void {
+    $this->enableModules([
+      'layout_builder',
+      'layout_discovery',
+      'block',
+      'contextual'
+    ]);
+    $type_definition = $this->container->get('config.typed')
+      ->getDefinition('block.settings.inline_block:*');
+    $definition = new $type_definition['definition_class']($type_definition);
+    $definition->setClass($type_definition['class']);
+    $typed_data = $type_definition['class']::createInstance($definition);
+    $typed_data->setValue([
+      'id' => 'inline_block:basic',
+      'label' => 'Test Title',
+    ]);
+    $label_data = $typed_data->get('label');
+    $this->assertInstanceOf(StringData::class, $label_data);
+  }
+
 }
heddn’s picture

The trick seems to be adding $definition->setTypedDataManager($this->typedConfigManager); in the form class. Manually testing and executing tests locally, things are now passing green again. Oh, I also had to fix some of the tests.

However, #3127026: Not possible to override an entity type class multiple times is biting us from upstream so tests are again not passing green on the testbot.

joseph.olstad’s picture

Ok @heddn very good, you've fixed the Drupal 10.4.x testing somehow.

However Drupal 11 testing results is curiously vastly different. Perhaps since it's testing against 11.x-dev instead of 11.1.8 or 11.2.2?

If we're testing off of 11.x there is a higher chance of seeing turbulence when compared to say testing against 11.1.8 or 11.2.2.

The Drupal 11 pipelines show 14 failures in the most recent run.

Not sure if this is of any help however we have been successfully using layout_builder_st dev-2.0.x 68f690c8fb with Drupal 11.1.8 extensively with this concoction of patches:

This bunch of patches that have recently been merged.
#3411037: Contextual links for translation are removed by core
#3420063: Error: Call to a member function getConfig() OverridesSectionStorage.php
and
#3420063: Error: Call to a member function getConfig() OverridesSectionStorage.php

All of which have now been marked as fixed however they were NOT merged into 2.0.x for some reason

Others outside of my groups have builds with layout_builder_st dev-2.0.x with a variety of patches applied and using Drupal 11.1+

Wondering why Drupal 11..x-dev testing would suddenly show 14 pipeline failures. Previously there were 3 with 22 skips, maybe because now there's only 21 skipped? Maybe the non-skipped test has a lot of failures now that it's no longer skipped?

Prior to recent changes;
Tests: 38, Assertions: 1100, Errors: 1, Failures: 3, PHPUnit Deprecations: 1, Skipped: 22.
https://git.drupalcode.org/project/layout_builder_st/-/jobs/5051465

Latest pipeline run:

Tests: 38, Assertions: 98, Errors: 14, PHPUnit Deprecations: 60, Skipped: 21.
https://git.drupalcode.org/project/layout_builder_st/-/jobs/5051465

joseph.olstad’s picture

@heddn, great work, seems like you've pushed things further along! OOPS

Seems as if we forgot all the work that has been done in 2.0.x and that folks have been using 2.0.x with Drupal 11+

  • heddn committed b8d50b83 on 2.0.x
    Issue #3520741 by heddn: Fix head tests or fix related functionality if...
heddn’s picture

Status: Active » Fixed

This goes a long way to improving tests. There are still failing tests, but they are blocked on #3127026: Not possible to override an entity type class multiple times landing upstream.

heddn credited millerrs.

heddn’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joseph.olstad’s picture

Serious chaos has happened with layout_builder_st
we had @phenaproxima running things, he ended up doing a build of 2.0.x that we have been using successfully with Drupal 11.1.8

Now I see the latest 2.0.x won't even run testing as it says this:

8) Drupal\Tests\layout_builder_st\Functional\Rest\LayoutBuilderEntityViewDisplayJsonBasicAuthTest::testGet
Unable to install modules: module 'layout_builder_st' is incompatible with this version of Drupal core.

@phenaproxima basically did some heavy modifications from 1x to 2.0.x. It was functional and we have been using it since several months. However there's now been a major reversal on the approach, a new maintainer, did you guys even have a discussion before handoff .

Here's what we have been using with Drupal 11.1.8

            "name": "drupal/layout_builder_st", 
            "version": "dev-2.0.x",
            "source": {
                "type": "git",
                "url": "https://git.drupalcode.org/project/layout_builder_st.git",
                "reference": "68f690c8fb7a679128deaa22bc3d5f0272caec18"
            },
            "require": {
                "drupal/core": "^10 || ^11"
            },

with these patches

                    "drupal/layout_builder_st": {
                        "3411037 - Fix core removing contextual translation links": "https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/5.patch", 
                        "3420063 - Call to a member function getConfig() OverridesSectionStorage.php": "https://git.drupalcode.org/project/layout_builder_st/-/merge_requests/6.diff",
                        "3069964 - Null fix for moderation dashboard, otherwise WSOD on login": "https://www.drupal.org/files/issues/2025-01-02/3069964-null-fix.patch"
                    },