schmittjoh / JMSSerializerBundle

Easily serialize, and deserialize data of any complexity (supports XML, JSON, YAML)
http://jmsyst.com/bundles/JMSSerializerBundle
MIT License
1.8k stars 312 forks source link

Twig serialization broken #911

Closed bobvandevijver closed 1 year ago

bobvandevijver commented 1 year ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

Looks like the v5 upgrade broke serialization from Twig templates when using |jms_serialize with the following message:

Unable to load the "JMS\Serializer\Twig\SerializerRuntimeHelper" runtime.

I believe this is caused by the missing twig.runtime tag, from this change: https://github.com/schmittjoh/JMSSerializerBundle/compare/4.2.0...5.0.0#diff-5dc7d7dcf78698e0d0cf5b1113d5c44c036a217a689f35f3d336bacae13d06abL248

Edit: restoring the tag solves the issue for me, so I made a PR for it.

goetas commented 1 year ago

https://github.com/schmittjoh/JMSSerializerBundle/pull/912