DDC-2300: Xmldriver does not convert the version field to boolean but keeps it as a SimpleXMLElement which breaks serialization #3003

Closed
doctrinebot opened this Issue Feb 16, 2013 · 1 comment

2 participants

@doctrinebot

Jira issue originally created by user jaco:

Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element:

Doctrine\ORM\Mapping\ClassMetadata Object
(
    [fieldMappings] => Array
        (
            [version] => Array
                (
                    [fieldName] => version
                    [type] => integer
                    [columnName] => version
                    [version] => SimpleXMLElement Object
                        (
                            [0] => true
                        )

                    [default] => 1
                    [declared] => path to entity
                )

The fix is simple change in the columnToArray method in the XML driver class:

changing:

$mapping['version'] = $fieldMapping['version'];

to:

$mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3.3 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment