Cannot initialize readonly property in PrivateMessageForm

Created on 18 August 2025, 7 days ago

Problem/Motivation

I have added an image field to my private message entities. When I try to post a Private Message I get the following error.

Error: Cannot initialize readonly property Drupal\private_message\Form\PrivateMessageForm::$typedDataManager from scope Drupal\Core\Form\FormBase in Drupal\Core\Form\FormBase->__wakeup() (line 81 of /.../web/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php).

This only happens if I upload an image in the newly added field. If I leave the image field empty there is no error and it posts successfully

Steps to reproduce

Proposed resolution

This is similar to the bug reported in πŸ’¬ Error: Cannot initialize readonly property Active . and will post a MR with a similar solution.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024