Skip to content

Resolve "fix(core): transfer function is overwritten by defaults when launching a config"

Description

Data-specific XML parsers are executed whenever an object is created in an XML configuration. We discovered they were also executed with referenced objects, which could lead to objects overwritten with defaults. This happened for instance with transfer functions. We no longer execute the parsers in these cases.

On the other side, objects created in activities do not benefit from this mechanism. This means that after this first change, an activity having a transfer function as a requirement with create="true" would create an empty transfer function. Many services do not handle that correctly.

It turns out to be desirable to also allow specifying initial object configuration for requirements. Example from the unit test, which set the value "dummy string" to the requirement string:

    <extension implements="sight::activity::extension::Activity">
        <id>TestBuilderObjectParser</id>
        <title>ObjectParser</title>
        <desc>Desc Test1</desc>
        <icon>Icon Test1</icon>
        <requirements>
            <requirement name="string" type="sight::data::String" minOccurs="0" maxOccurs="1" create="true">
                <config>
                    <value>dummy string</value>
                </config>
            </requirement>
        </requirements>
        <appConfig id="TestBuilderCfg1" />
    </extension>

Closes #1034 (closed)

How to test it?

Repeat the steps described in #1034 (closed), but at the end, observe the TF only shows the bones.

Edited by Flavien BRIDAULT

Merge request reports