mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-13 14:25:17 +03:00
Fix ID scanning in form-add and title emission in form-compile
form-add: Scan column IDs (same pool as attribute IDs) to prevent duplicate ID collisions. Use XPath .//*[@id] instead of ChildItems recursion to capture companion element IDs (ExtendedTooltip, ContextMenu). form-compile: Extract title from properties and route through Emit-MLText instead of generic Emit-Properties, which produced plain text <Title> rejected by 1C XDTO schema. Found during E2E testing of full pipeline (epf-init → form-compile → form-add → epf-build). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -978,13 +978,27 @@ $script:nextId = 1
|
||||
X '<?xml version="1.0" encoding="UTF-8"?>'
|
||||
X '<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcssch="http://v8.1c.ru/8.1/data-composition-system/schema" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.17">'
|
||||
|
||||
# 12a. Title
|
||||
if ($def.title) {
|
||||
Emit-MLText -tag "Title" -text "$($def.title)" -indent "`t"
|
||||
# 12a. Title (from def.title or properties.title — must be multilingual XML)
|
||||
$formTitle = $def.title
|
||||
if (-not $formTitle -and $def.properties -and $def.properties.title) {
|
||||
$formTitle = $def.properties.title
|
||||
}
|
||||
if ($formTitle) {
|
||||
Emit-MLText -tag "Title" -text "$formTitle" -indent "`t"
|
||||
}
|
||||
|
||||
# 12b. Properties
|
||||
Emit-Properties -props $def.properties -indent "`t"
|
||||
# 12b. Properties (skip 'title' — handled above as multilingual)
|
||||
if ($def.properties) {
|
||||
$propsClone = New-Object PSObject
|
||||
foreach ($p in $def.properties.PSObject.Properties) {
|
||||
if ($p.Name -ne "title") {
|
||||
$propsClone | Add-Member -NotePropertyName $p.Name -NotePropertyValue $p.Value
|
||||
}
|
||||
}
|
||||
Emit-Properties -props $propsClone -indent "`t"
|
||||
} else {
|
||||
Emit-Properties -props $null -indent "`t"
|
||||
}
|
||||
|
||||
# 12c. CommandSet (excluded commands)
|
||||
if ($def.excludedCommands -and $def.excludedCommands.Count -gt 0) {
|
||||
|
||||
Reference in New Issue
Block a user