Dependency serialization trait missing on ConfigureAction

Created on 21 October 2024, about 1 month ago

Hey there,

In https://git.drupalcode.org/project/views_bulk_operations/-/commit/01cee7... you refactored a bunch of classes and changed the notation of parameters in the __construct methods. But in the same process, you marked them as readonly which provides some BC issues.

We noticed ConfigureAction to be problematic in cases in which the action plugin config form uses a more complex, ajax based logic which serializes and unserializes the form. And when this happens, it errors out with:

Error: Cannot initialize readonly property Drupal\views_bulk_operations\Form\ConfigureAction::$tempStoreFactory from scope Drupal\Core\Form\FormBase in Drupal\Core\Form\FormBase->__wakeup() (line 81 of /var/www/html/build/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php).

...namely, it cannot reinstantiate the form because the parameter is now readonly and cannot be set from the parent class which uses the dependency serialization trait. So we need to add it also to this class or remove the readonly support.

🐛 Bug report
Status

Needs work

Version

4.3

Component

Core

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