Error from widget (Cannot initialize readonly property)

Created on 23 May 2025, about 1 month ago

Problem/Motivation

Follows Field widget Active

The following error is thrown when the form is retrieved from cache:

Error: Cannot initialize readonly property Drupal\slim_select\Plugin\Field\FieldWidget\SlimSelectWidget::$configFactory from scope Drupal\Core\Plugin\PluginBase in Drupal\Core\Plugin\PluginBase->__wakeup() (line 80 of core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php).

Steps to reproduce

- Apply slim_select widget on article field_tags
- Edit field_tags field and attempt to change the "Reference method", save > the error is thrown

Proposed resolution

It seems this already reported here in core: 📌 Allow DependencySerializationTrait to work with readonly properties Active
For now remove readonly when injecting the config factory.

Remaining tasks

?

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium herved

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