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

        Jaco Stienstra created issue -
        Jaco Stienstra made changes -
        Field Original Value New Value
        Description Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element:

        {{monospaced}}
        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
                        )
        {{monospaced}}

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

        changing:
        {{monospaced}}
        $mapping['version'] = $fieldMapping['version'];
        {{monospaced}}

        to:
        {{monospaced}}
        $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
        {{monospaced}}
        Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element:

        {quote}
        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
                        )
        {quote}

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

        changing:
        {quote}
        $mapping['version'] = $fieldMapping['version'];
        {quote}

        to:
        {quote}
        $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
        {quote}
        Marco Pivetta made changes -
        Description Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element:

        {quote}
        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
                        )
        {quote}

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

        changing:
        {quote}
        $mapping['version'] = $fieldMapping['version'];
        {quote}

        to:
        {quote}
        $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
        {quote}
        Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element:

        {code}
        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
                        )
        {code}

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

        changing:
        {code}
        $mapping['version'] = $fieldMapping['version'];
        {code}

        to:
        {code}
        $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
        {code}
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.3 [ 10329 ]
        Resolution Fixed [ 1 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2300, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: