Hi,
I have exactly the same issue than for media_library_extend : https://www.drupal.org/project/media_library_extend/issues/3097361 :
Uploading media using the Media Library widget does no longer work.
The following error occured :

LogicException: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in Drupal\Core\Database\Connection->__sleep()

Making the custom decorator "public" fixes the issue.

Comments

cutesquirrel created an issue. See original summary.

cutesquirrel’s picture

StatusFileSize
new423 bytes

Here is my patch

spadxiii’s picture

This looks like it's a duplicate of #3133318: Revert #3058063 - Regression on form rebuild and wrong decorator pattern
I've added a patch in that issue to solve the serialization-exception.