Deprecated function: Creation of dynamic property Drupal\content_lock\ContentLock\ContentLock::$time is deprecated

Created on 24 April 2024, 7 months ago
Updated 30 April 2024, 7 months ago

Problem/Motivation

Steps to reproduce

Upgrade to PHP 8.2 and see this warning:

Deprecated function: Creation of dynamic property Drupal\content_lock\ContentLock\ContentLock::$time is deprecated in Drupal\content_lock\ContentLock\ContentLock->__construct() (line 139 of modules/contrib/content_lock/src/ContentLock/ContentLock.php).

Drupal\content_lock\ContentLock\ContentLock->__construct(Object, Object, Object, Object, Object, Object, Object, Object, Object) (Line: 259)
Drupal\Component\DependencyInjection\Container->createService(Array, 'content_lock') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('content_lock') (Line: 197)
Drupal::service('content_lock') (Line: 366)
content_lock_entity_operation(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'content_lock') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_operation', Object) (Line: 408)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_operation', Array) (Line: 125)
Drupal\Core\Entity\EntityListBuilder->getOperations(Object) (Line: 138)
Drupal\views\Plugin\views\field\EntityOperations->render(Object) (Line: 1196)
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 238)
template_preprocess_views_view_field(Array, 'views_view_field', Array)
call_user_func_array('template_preprocess_views_view_field', Array) (Line: 261)
Drupal\Core\Theme\ThemeManager->render('views_view_field', Array) (Line: 480)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer->render(Array) (Line: 1790)
Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 765)
Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array)
call_user_func_array(Array, Array) (Line: 111)
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: 859)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 421)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer->render(Array) (Line: 704)
Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 570)
Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 458)
Drupal\views\Plugin\views\style\StylePluginBase->render() (Line: 2174)
Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1575)
Drupal\views\ViewExecutable->render() (Line: 199)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1672)
Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 81)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 111)
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: 859)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 421)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
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: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->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: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Closed: duplicate

Version

2.3

Component

Code

Created by

🇺🇸United States bdanin

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024