Handle serialization and unserialization of service closures

Created on 4 September 2025, 1 day ago

Problem/Motivation

As using closures becomes more prevalent in order to inject services lazily, whether in service definition argument definitions or manually created closures in plugin classes (such as in 📌 Replace SearchBlock service properties with service closures Active ), these closures must be handled when the class needs to be serialized in order prevent errors, since closures are not serializable.

Steps to reproduce

Proposed resolution

Plugin classes extending PluginBase already use DependencySerializationTrait, and the code in DependencySerializationTrait can be updated to handle removing service closure properties from being serialized in __sleep(), as well as rehydrating the closure properties in __wakeup()

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

base system

Created by

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