editTag not working as expected (>= 7.9.4)

Hello all,

I guess I have found a regression in the system.tag.editTag method.

Since version 7.9.4, i cannot override properties in a nested child UDT. I have made a parent UDT, containing a child UDT. Each one contains a simple integer value. (See joined files)

On a 7.9.5 (and on 7.9.4 also I guess), I can override the value at the root of the Parent UDT, but not the other ones.
The exact same UDT and code works perfectly on a 7.9.3 (all values can be overriden)

The code is executed from the Script Console, in the Designer (not from a Vision Client). I also disabled the tag permission “Tag Editing” (just to be sure).

Steps to reproduce:
Import Enfant.xml
Import Parent.xml
Instanciate a Parent in root directory. Name it “testTag”
Run the script.

Works for <= 7.9.3. Does not work on 7.9.5.

valeurAEcrire = system.date.getSecond(system.date.now())
system.tag.editTag(tagPath = "tagTest", overrides = {"Repertoire/Valeur":{"Value": valeurAEcrire}} )
system.tag.editTag(tagPath = "tagTest", overrides = {"Enfant/Valeur":{"Value": valeurAEcrire}} )
system.tag.editTag(tagPath = "tagTest", overrides = {"Repertoire/Enfant/Valeur":{"Value": valeurAEcrire}} )
system.tag.editTag(tagPath = "tagTest", overrides = {"Valeur":{"Value": valeurAEcrire}} )

Enfant.xml (344 Bytes)
Parent.xml (1.0 KB)

I have had problems with overriding parameters as well with editTag. I wasn’t aware it was a version thing. My workaround has been to only use addTag. If the tag exists, remove it and recreate. Thanks for pointing that out.

Kurt

I just ran into this same problem today. The release notes for 7.9.6 don’t indicate that this has been corrected. Did you ever find a workaround?

I event found any valid workaround for that (except deleting the tag and recreate it).
Howerver, I recently got updated by the support that this problem will be corrected for a future version (surely 7.9.8).

Yes, this was a known regression - the fix is in 7.9.8.

Hi, I have the same issue now.
It edits the parent UDT instead of the child.
Do you have any ideas?

I have had success in updating nested UDT subtag properties with editTag, but only for nested UDTs that are one level deep. It seems the function doesn’t behave well with tags that are under 2 or more levels of UDTs.

I have the following structure:

  • Root UDT (params)
    • myRootTag
    • Level 1 UDT (params)
      • myLevel1Tag
      • Level 2 UDT (params)
        • myLevel2Tag

The editTag parameters are as follows:

system.tag.editTag(
    tagPath = '[default]DirectoryPath/Root UDT/Level 1 UDT/ Level 2 UDT',
    overrides = {'/myLevel2Tag' : {'OPCServer' : 'myServer', 'ScanClass' : 'myScanClass'}}
)

The above syntax does not seem to work. I need to update ~100 of these tags.

I was using the wrong format :frowning:

What does work:

system.tag.editTag(
    tagPath = '[default]DirectoryPath/Root UDT',
    overrides = {'/Level 1 UDT/Level 2 UDT/myLevel2Tag' : {'OPCServer' : 'myServer', 'ScanClass' : 'myScanClass'}}
)