Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299604

'xml' format broken: Symfony's XmlEncoder maps a single-item array to a non-array

$
0
0

While working on #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method, I discovered a rather nasty problem with the xml format. On the (de)normalizer side, not the encoder/decoder side.

STR:

$serialized_test = $this->serializer->serialize($node, 'xml');
$unserialized_test = $this->serializer->deserialize($serialized_test, get_class($node), 'xml');

That should serialize a Node entity to the xml format and deserialize it again.

What actually happens: Symfony\Component\Serializer\Exception\UnexpectedValueException: A string must be provided as a bundle value., thrown at core/modules/serialization/src/Normalizer/EntityNormalizer.php:74.

For failing test, please await #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method.


Viewing all articles
Browse latest Browse all 299604

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>