Problem/Motivation

When using thi smodule in Drupal 10 with php 8.2 I get this alerts:

Deprecated function: Creation of dynamic property Drupal\layout_builder_blocks\EventSubscriber\BlockComponentRenderArraySubscriber::$stylesGroupManager is deprecated in Drupal\layout_builder_blocks\EventSubscriber\BlockComponentRenderArraySubscriber->__construct() (line 44 of modules/contrib/layout_builder_blocks/src/EventSubscriber/BlockComponentRenderArraySubscriber.php).

Drupal\layout_builder_blocks\EventSubscriber\BlockComponentRenderArraySubscriber->__construct(Object, Object, Object) (Line: 259)
Drupal\Component\DependencyInjection\Container->createService(Array, 'layout_builder_blocks.render_block_component_subscriber') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('layout_builder_blocks.render_block_component_subscriber') (Line: 105)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'section_component.build.render_array') (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray(Array, ) (Line: 88)
Drupal\layout_builder\Section->toRenderArray(Array) (Line: 316)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections(Object) (Line: 275)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 339)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 281)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 238)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func_array(Array, Array) (Line: 101)
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. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
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(Object, 'kernel.view') (Line: 168)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 68)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
CommentFileSizeAuthor
#3 3363647-3-deprecateds.patch724 bytesaleix
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

aleix created an issue. See original summary.

aleix’s picture

Status: Active » Needs review
StatusFileSize
new724 bytes

Adding patch for composer patches

rajab natshah’s picture

carolpettirossi’s picture

Status: Needs review » Reviewed & tested by the community

I applied the patch on my project and the deprecation notices are gone.

I was facing the deprecation notices in any node with layout builder.

pfeiffer’s picture

After applying this patch on a Drupal 10.1.2 site the deprecation notices are gone.

rajab natshah’s picture

Title: Deprecation notices » Fix deprecation notices with PHP 8.2 and Drupal 10
Issue tags: +PHP 8.2

  • Rajab Natshah committed 09e41b94 on 1.0.x authored by aleix
    Issue #3363647 by aleix: Fix deprecation notices with PHP 8.2 and Drupal...
rajab natshah’s picture

Status: Reviewed & tested by the community » Fixed
rajab natshah’s picture

Category: Task » Bug report

Status: Fixed » Closed (fixed)

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