Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1226

Nulls go missing in CopyHelper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • C++-SCA-Next
    • None
    • C++ SDO
    • None
    • PHP, WIn32

    Description

      This is perhaps a variation on Tuscany-1225. Problem is that when using CopyHelper to clone a DataObject, properties which are set to null remain unset in the destination DataObject.

      Example:
      SCHEMA:
      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="PersonNamespace"
      xmlns:AuthorNS="PersonNamespace">
      <complexType name="personType">
      <sequence>
      <element name="name" type="string"/>
      <element name="dob" type="string"/>
      <element name="pob" type="string"/>
      </sequence>
      </complexType>
      </schema>

      logic:
      $xmldas = SDO_DAS_XML::create('person.xsd');

      $person = $xmldas->createDataObject('PersonNamespace','personType');

      $person->name = "William Shakespeare'";
      $person->dob = null;
      $person->pob = null;

      $person2 = clone($person);

      After the clone the php $person looks like:

      object(SDO_DataObject)#3 (3)

      {name=>"William Shakespeare'"; dob=>NULL; pob=>NULL}

      but $person2 is:
      object(SDO_DataObject)#4 (3)

      {name=>"William Shakespeare'"; dob; pob}

      (I can't show you the Tuscany print of the DO, because it causes an AccessViolation )

      Problem is perhaps that transferitem() doesn't consider nulls

      Attachments

        1. Tuscany-1226.patch
          1 kB
          Caroline Maynard

        Activity

          People

            Unassigned Unassigned
            cem Caroline Maynard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: