[IGN-13867] 8.3 issue copying UDTs between tag providers

When I run automated unit tests, I copy UDTs from the default tag provider to a tag provider called test1 during setup. This worked fine with 8.1 but I’m getting duplicate tags with 8.3. I reduced the issue down to a simple example. I think it has to do with inheritance.

The following is an example UDT structure in the default tag provider. SubUdt inherits from Udt.

When I copy from tag provider default to tag provider test1 with command

system.tag.copy(["[default]_types_/Test"], "[test1]_types_/", collisionPolicy='o')

I get duplicate tags in the inherited UDT. The test1 tag provider was empty before I ran the copy function.

Here is a tag export JSON for this example:

{
  "name": "Test",
  "tagType": "Folder",
  "tags": [
    {
      "name": "SubFolder",
      "tagType": "Folder",
      "tags": [
        {
          "name": "SubUdt",
          "typeId": "Test/Udt",
          "tagType": "UdtType",
          "tags": [
            {
              "name": "Integer",
              "tagType": "AtomicTag"
            }
          ]
        }
      ]
    },
    {
      "name": "Udt",
      "tagType": "UdtType",
      "tags": [
        {
          "valueSource": "memory",
          "name": "Integer",
          "value": 5,
          "tagType": "AtomicTag"
        }
      ]
    }
  ]
}

Thank you for reporting this. I have confirmed that there is an issue and have filed a bug internally to address it.

Garth

1 Like

I think I have seen this same issue in version 8.1 using system.tag.configure instead of system.tag.copy.

My not so elegant solution was to run the system.tag.configure call twice. The second time cleaned up the duplicate tags. I assume the issue is with the order the UDTs are being created. Basically, copying the child UDT before the parent UDT.

Yes, I was getting the same issue doing the copy with the system.tag.configure method:

exportString = system.tag.exportTags(tagPaths=["[default]_types_/Test"])
system.tag.configure(basePath="[test1]_types_/", tags=exportString, collisionPolicy='o')

but it still worked in 8.1 for me. When I manually export the tags in the designer and re-import them in the other tag provider, it works fine in 8.3.