Found while storing a reference to the CalendarDownloadDefaultWidget in a form array: The widget contains an instance of CalendarPropertyProcessor, which contains injected services but is not itself a service. That causes Drupal to try to serialize the services, and fails by serializing the database connection.

Drupal's common pattern is to use DependencySerializationTrait in such classes, which looks for object variables that are injected services, and strips them out before serialization.

(I'm not sure how much of a problem this is, as I was making an error myself when I triggered it, but plugins in Drupal are usually serializable objects.)

Comments

cburschka created an issue. See original summary.

cburschka’s picture

Status: Active » Needs review

stefanos.petrakis’s picture

Status: Needs review » Fixed

Commited, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.