Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2300

Xmldriver does not convert the version field to boolean but keeps it as a SimpleXMLElement which breaks serialization

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.3
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      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']);
      

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jaco Stienstra
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: