Error: Cannot initialize readonly property Drupal\og\Plugin\Field\FieldWidget\OgComplex::$membershipManager

Created on 14 February 2025, 8 days ago

Problem/Motivation

Error: Cannot initialize readonly property Drupal\og\Plugin\Field\FieldWidget\OgComplex::$membershipManager from scope Drupal\Core\Plugin\PluginBase in Drupal\Core\Plugin\PluginBase->__wakeup() (line 81 of core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php).
I'm getting this error when trying to save a group content.

Call stack:

unserialize() (Line: 21)
Drupal\Component\Serialization\PhpSerialize::decode()
array_map() (Line: 79)
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->getMultiple() (Line: 35)
Drupal\Core\KeyValueStore\StorageBase->get() (Line: 121)
Drupal\Core\Form\FormCache->getCache() (Line: 456)
Drupal\Core\Form\FormBuilder->getCache() (Line: 270)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1. Create a new og content and put something in the 'Other groups' field.
2. Save

Proposed resolution

Remove readonly properties in the constructor for OgComplex class.

🐛 Bug report
Status

Active

Version

1.0

Component

og.module

Created by

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

Comments & Activities

Production build 0.71.5 2024