Commit d8455c7a authored by Mike Hibler's avatar Mike Hibler

Minor parser change to preserve DB unique key.

If new elabinelab_attribute has same role/key/order, replace any existing
such element.  This preserves what we have set in the DB as the unique key.
parent 1e12f604
......@@ -1782,6 +1782,15 @@ proc tb-set-elabinelab-attribute {role key value {order 0}} {
perror "\[tb-set-elabinelab-attribute] - \"$order\" is not a valid elabinelab order"
return
}
#
# If role/key/ordering exactly matches an existing value, replace it
# otherwise just add it.
#
set i [lsearch -glob $elabinelab_attributes "$role,$key,*,$order"]
if {$i > -1} {
set elabinelab_attributes [lreplace $elabinelab_attributes $i $i]
}
lappend elabinelab_attributes "$role,$key,$value,$order"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment