- Issue created by @Stefan Lehmann
We have a custom entity with a decimal field and that seems to cause an error in ListDataDefinitionNormalizer.php.
Create a custom entity with following BaseFieldDefinition:
$fields['test'] = BaseFieldDefinition::create('decimal')
->setRequired(FALSE)
->setRevisionable(TRUE)
->setSetting('precision', 12)
->setSetting('scale', 2)
->setLabel('test');
Go to the Schema page and you should see an error like:
TypeError: Symfony\Component\Serializer\Serializer::normalize(): Return value must be of type ArrayObject|array|string|int|float|bool|null, stdClass returned in Symfony\Component\Serializer\Serializer
I hunted it down to this line here in ComplexDataDefinitionNormalizer.php:
$normalized = $this->extractPropertyData($entity);
$normalized contains a key "value" which is a StdClass object. Other field types don't seem to have that key there. I hope that helps.
Active
Code