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

Closed
opened 2026-01-22 14:06:45 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Feb 16, 2013).

Originally assigned to: @beberlei on GitHub.

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']);
Originally created by @doctrinebot on GitHub (Feb 16, 2013). Originally assigned to: @beberlei on GitHub. 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']); ```
admin added the Bug label 2026-01-22 14:06:45 +01:00
admin closed this issue 2026-01-22 14:06:45 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 14, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Mar 14, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2889