PHP 8.3 Deprecated function: Creation of dynamic property

Created on 8 August 2024, 4 months ago

Problem/Motivation

Deprecated function: Creation of dynamic property Drupal\layout_builder\SectionComponent::$thirdPartySettings is deprecated in Drupal\memcache\Driver\MemcacheDriver->getMulti() (line 60 of /var/www/html/modules/contrib/memcache/src/Driver/MemcacheDriver.php)

#0 /var/www/html/core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/modules/contrib/memcache/src/Driver/MemcacheDriver.php(60): MemcachePool->get()
#3 /var/www/html/modules/contrib/memcache/src/MemcacheBackend.php(144): Drupal\memcache\Driver\MemcacheDriver->getMulti()
#4 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(1099): Drupal\memcache\MemcacheBackend->getMultiple()
#5 /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(391): Drupal\Core\Entity\ContentEntityStorageBase->getFromPersistentCache()
#6 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(312): Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple()
#7 /var/www/html/core/lib/Drupal/Core/Entity/EntityRepository.php(183): Drupal\Core\Entity\EntityStorageBase->loadMultiple()
#8 /var/www/html/core/lib/Drupal/Core/Entity/EntityRepository.php(175): Drupal\Core\Entity\EntityRepository->getCanonicalMultiple()
#9 /var/www/html/core/lib/Drupal/Core/ParamConverter/EntityConverter.php(134): Drupal\Core\Entity\EntityRepository->getCanonical()
#10 /var/www/html/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php(100): Drupal\Core\ParamConverter\EntityConverter->convert()
#11 /var/www/html/core/lib/Drupal/Core/Access/AccessManager.php(90): Drupal\Core\ParamConverter\ParamConverterManager->convert()
#12 /var/www/html/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php(218): Drupal\Core\Access\AccessManager->checkNamedRoute()
#13 /var/www/html/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php(107): Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->menuLinkCheckAccess()
#14 /var/www/html/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php(111): Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess()
#15 [internal function]: Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess()
#16 /var/www/html/core/lib/Drupal/Core/Menu/MenuLinkTree.php(153): call_user_func()
#17 /var/www/html/modules/contrib/menu_block/src/Plugin/Block/MenuBlock.php(394): Drupal\Core\Menu\MenuLinkTree->transform()
#18 /var/www/html/modules/contrib/menu_block/src/Plugin/Block/MenuBlock.php(426): Drupal\menu_block\Plugin\Block\MenuBlock->build()
#19 /var/www/html/core/lib/Drupal/Core/Block/BlockPluginTrait.php(127): Drupal\menu_block\Plugin\Block\MenuBlock->blockAccess()
#20 /var/www/html/core/modules/block/src/BlockAccessControlHandler.php(124): Drupal\Core\Block\BlockBase->access()
#21 /var/www/html/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(109): Drupal\block\BlockAccessControlHandler->checkAccess()
#22 /var/www/html/core/lib/Drupal/Core/Entity/EntityBase.php(329): Drupal\Core\Entity\EntityAccessControlHandler->access()
#23 /var/www/html/core/modules/block/src/BlockRepository.php(63): Drupal\Core\Entity\EntityBase->access()
#24 /var/www/html/core/modules/block/src/Plugin/DisplayVariant/BlockPageVariant.php(138): Drupal\block\BlockRepository->getVisibleBlocksPerRegion()
#25 /var/www/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(270): Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build()
#26 /var/www/html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#27 /var/www/html/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#28 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#29 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#30 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#31 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#32 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#33 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#34 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#35 /var/www/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#36 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#37 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch()
#38 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup()
#39 /var/www/html/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle()
#40 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle()
#41 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#42 /var/www/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#43 /var/www/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#44 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#45 /var/www/html/index.php(19): Drupal\Core\DrupalKernel->handle()
#46 {main}

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇭🇰Hong Kong hswong3i

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @hswong3i
  • Status changed to Needs review 4 months ago
  • 🇮🇳India sarwan_verma

    Hi ,
    I have resolved the " Deprecated function" issue and also attached patch ,
    please review and verify.
    thanks!

  • Status changed to Needs work 4 months ago
  • 🇺🇸United States japerry KVUO

    This is not an issue with memcache, and the patch in #4 is not correct, as $memcache is already defined in DriverBase. Not closing the issue yet, because there -might- be a problem with how we're caching object classes (stripping their definitions).

  • 🇺🇸United States Chris Burge

    I'm running into the same notice in the issue description, and it's filling the logs every request. I can't explain it, but patch #4 fixes it. No more notices.

  • 🇺🇸United States Chris Burge

    I spoke too soon. I don't believe Memcache is at fault.

    The SectionComponent class has never had a thirdPartySettings property. It is proposed in Support third party settings for components within a section Needs work ; however.

    @hswong3i has your site previously run a patch from Support third party settings for components within a section Needs work ?

    When a Layout Builder component is serialized for storage, it includes properties from its SectionComponent object. If a site is patched to add third-party settings to to LB components and that patch is later removed, you'll get the notice you posted. This is the same error without Memcache enabled:

    Deprecated function: Creation of dynamic property Drupal\layout_builder\SectionComponent::$thirdPartySettings is deprecated in Drupal\Component\Serialization\PhpSerialize::decode() (line 21 of /var/www/html/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php) 
    

    I suspect if you search the database, you'll find orphaned thirdPartySettings properties inside serialized SectionComponent objects.

Production build 0.71.5 2024