Score:0

Unexpected error from a layout page

us flag

I am working with Manage display, but for one of my pages I get an error occurring on the Layout page.

Error: Call to a member function getEntityTypeId() on null in Drupal\layout_builder\Plugin\Block\InlineBlock->build() (line 223 of core/modules/layout_builder/src/Plugin/Block/InlineBlock.php).
Drupal\layout_builder\Plugin\Block\InlineBlock->build() (Line: 105)
Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object) call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('section_component.build.render_array', Object) (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray(Array, 1) (Line: 86)
Drupal\layout_builder\Section->toRenderArray(Array, 1) (Line: 250)
Drupal\layout_builder\Element\LayoutBuilder->buildAdministrativeSection(Object, 0) (Line: 123)
Drupal\layout_builder\Element\LayoutBuilder->layout(Object) (Line: 97)
Drupal\layout_builder\Element\LayoutBuilder->preRender(Array) call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

It has something to do with

Path: /colors/web/node/1/layout. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: The 'configure any layout' permission is required. in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 117 of /Users//Sites//web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).

Thanks.

Not working with one

Hodba Khalaf avatar
eg flag
You need to post more info about what caused the error, what are the installed modules from Layout Builder ecosystem. is it a custom block?
apaderno avatar
us flag
Welcome to Drupal Answers! Quoting an exception and showing a traceback isn't asking a question. There are many missing details from the question, which is just saying *I am working with Manage display, but for one of my pages I get an error occurring on the Layout page.* There isn't any way to reproduce the issue without more details. We cannot debug a site to which we don't have access. You need to debug what happens and adds what you find out to the question.
apaderno avatar
us flag
I would start investigating on why `Drupal\layout_builder\Plugin\Block\InlineBlock::build()` gets a `NULL` value when it's sure to get a class instance. It could be the *Layout Builder* module should simply verify it gets what it expects (and that would be a Drupal core bug that needs to be reported), or it could be another module is wrongly setting to `NULL` an entity object (and it would be a bug in that module). Unfortunately, the backtrace doesn't help in understanding that.
us flag
Yes basically, I am getting an error with Layout where one of the actual page is not working.
us flag
Okay now it works! the front page is a node, the anonymous user role requires 'View published content' permissions.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.