fix(meta-edit): modify.properties не создаёт элемент свойства-списка в обход проверок

modify.properties создавал отсутствующий элемент до Set-ComplexProperty, и решение
Get-ListPropertyElement обходилось: пустой список дописывал <RegisterRecords/>
заимствованному объекту, а у обычного объекта без элемента не было отказа.
Свойство-список теперь уходит в Set-ComplexProperty до create-if-missing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-09-26 17:10:56 +03:00
co-authored by Claude Opus 5.5
parent cfd2d1be50
commit 2fc5659b47
20 changed files with 1338 additions and 24 deletions
+13 -13
View File
@@ -1,4 +1,4 @@
# meta-edit v1.56 — Edit existing 1C metadata object XML
# meta-edit v1.57 — Edit existing 1C metadata object XML
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
[CmdletBinding(PositionalBinding=$false)]
param(
@@ -2663,6 +2663,18 @@ function Modify-Properties($propsDef) {
$propName = $_.Name
$propValue = $_.Value
# Свойство-список: наличие элемента решает Get-ListPropertyElement (тип объекта, заимствование)
if ($script:complexPropertyMap.ContainsKey($propName)) {
$valuesList = @()
if ($propValue -is [array]) {
$valuesList = @($propValue | ForEach-Object { "$_" })
} else {
$valuesList = @("$propValue" -split ';;' | ForEach-Object { $_.Trim() } | Where-Object { $_ })
}
Set-ComplexProperty $propName $valuesList
return
}
# Find the property element in Properties
$propEl = $null
foreach ($child in $script:propertiesEl.ChildNodes) {
@@ -2687,18 +2699,6 @@ function Modify-Properties($propsDef) {
}
}
# Complex property: Owners, RegisterRecords, BasedOn, InputByString
if ($script:complexPropertyMap.ContainsKey($propName)) {
$valuesList = @()
if ($propValue -is [array]) {
$valuesList = @($propValue | ForEach-Object { "$_" })
} else {
$valuesList = @("$propValue" -split ';;' | ForEach-Object { $_.Trim() } | Where-Object { $_ })
}
Set-ComplexProperty $propName $valuesList
return
}
# Handle boolean values
$valueStr = "$propValue"
if ($propValue -is [bool]) {