mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-30 05:55:53 +03:00
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:
co-authored by
Claude Opus 5.5
parent
cfd2d1be50
commit
2fc5659b47
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user