diff --git a/.claude/skills/meta-edit/scripts/meta-edit.ps1 b/.claude/skills/meta-edit/scripts/meta-edit.ps1 index 7f089f95e..b67175e21 100644 --- a/.claude/skills/meta-edit/scripts/meta-edit.ps1 +++ b/.claude/skills/meta-edit/scripts/meta-edit.ps1 @@ -1,4 +1,4 @@ -# meta-edit v1.46 — Edit existing 1C metadata object XML +# meta-edit v1.47 — Edit existing 1C metadata object XML # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills [CmdletBinding(PositionalBinding=$false)] param( @@ -1505,7 +1505,14 @@ function Get-AllChildNames { $propsEl = $gc; break } } - if (-not $propsEl) { continue } + # Часть детей регистрируется голым текстом, без : Имя
, + #
Имя
, . Пропуская их, проверка «уже существует» + # становилась мёртвой — повторное добавление давало второй такой же узел. + if (-not $propsEl) { + $n = $child.InnerText.Trim() + if ($n) { $names[$n] = $child.LocalName } + continue + } foreach ($gc in $propsEl.ChildNodes) { if ($gc.NodeType -eq 'Element' -and $gc.LocalName -eq "Name") { $n = $gc.InnerText.Trim() diff --git a/.claude/skills/meta-edit/scripts/meta-edit.py b/.claude/skills/meta-edit/scripts/meta-edit.py index bcb0d145b..7fcfb38f2 100644 --- a/.claude/skills/meta-edit/scripts/meta-edit.py +++ b/.claude/skills/meta-edit/scripts/meta-edit.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-edit v1.46 — Edit existing 1C metadata object XML +# meta-edit v1.47 — Edit existing 1C metadata object XML # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -1522,7 +1522,13 @@ def get_all_child_names(): if localname(gc) == "Properties": props_el = gc break + # Часть детей регистрируется голым текстом, без : Имя
, + #
Имя
, . Пропуская их, проверка «уже существует» + # становилась мёртвой — повторное добавление давало второй такой же узел. if props_el is None: + n = (child.text or "").strip() + if n: + names[n] = localname(child) continue for gc in props_el: if localname(gc) == "Name": diff --git a/tests/skills/cases/meta-edit/eds-add-table-twice.json b/tests/skills/cases/meta-edit/eds-add-table-twice.json new file mode 100644 index 000000000..721a3f30a --- /dev/null +++ b/tests/skills/cases/meta-edit/eds-add-table-twice.json @@ -0,0 +1,27 @@ +{ + "name": "Повторное добавление таблицы не даёт второй записи в ChildObjects", + "setup": "empty-config", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { + "type": "ExternalDataSource", + "name": "PG", + "tables": { "products": { "keyFields": ["id"], "fields": ["id: Number(10,0)"] } } + }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "meta-edit/scripts/meta-edit", + "input": { "add": { "tables": { "sales": ["id: Number(10,0)"] } } }, + "args": { "-DefinitionFile": "{inputFile}", "-ObjectPath": "{workDir}/ExternalDataSources/PG.xml" } + }, + { "deletePath": "ExternalDataSources/PG/Tables/sales.xml" } + ], + "params": { "objectPath": "ExternalDataSources/PG.xml" }, + "input": { "add": { "tables": { "sales": ["id: Number(10,0)"] } } }, + "expect": { + "stdoutContains": ["already exists"], + "filesAbsent": ["ExternalDataSources/PG/Tables/sales.xml"] + } +} diff --git a/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Configuration.xml b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Configuration.xml new file mode 100644 index 000000000..da0e784ee --- /dev/null +++ b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Configuration.xml @@ -0,0 +1,252 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + UUID-008 + UUID-009 + + + UUID-010 + UUID-011 + + + UUID-012 + UUID-013 + + + UUID-014 + UUID-015 + + + + TestConfig + + + ru + TestConfig + + + + + Version8_3_24 + ManagedApplication + + PlatformApplication + + Russian + + + + + false + false + false + + + + + + + + + + + + + + + + + + + + + + Biometrics + true + + + Location + false + + + BackgroundLocation + false + + + BluetoothPrinters + false + + + WiFiPrinters + false + + + Contacts + false + + + Calendars + false + + + PushNotifications + false + + + LocalNotifications + false + + + InAppPurchases + false + + + PersonalComputerFileExchange + false + + + Ads + false + + + NumberDialing + false + + + CallProcessing + false + + + CallLog + false + + + AutoSendSMS + false + + + ReceiveSMS + false + + + SMSLog + false + + + Camera + false + + + Microphone + false + + + MusicLibrary + false + + + PictureAndVideoLibraries + false + + + AudioPlaybackAndVibration + false + + + BackgroundAudioPlaybackAndVibration + false + + + InstallPackages + false + + + OSBackup + true + + + ApplicationUsageStatistics + false + + + BarcodeScanning + false + + + BackgroundAudioRecording + false + + + AllFilesAccess + false + + + Videoconferences + false + + + NFC + false + + + DocumentScanning + false + + + SpeechToText + false + + + Geofences + false + + + IncomingShareRequests + false + + + AllIncomingShareRequestsTypesProcessing + false + + + + + + Normal + + + Language.Русский + + + + + + Managed + NotAutoFree + DontUse + DontUse + TaxiEnableVersion8_2 + DontUse + Version8_3_24 + + + + Русский + PG + + + \ No newline at end of file diff --git a/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Ext/ClientApplicationInterface.xml b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Ext/ClientApplicationInterface.xml new file mode 100644 index 000000000..3c1161b2d --- /dev/null +++ b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Ext/ClientApplicationInterface.xml @@ -0,0 +1,18 @@ + + + + + UUID-002 + + + + + UUID-004 + + + + + + + + \ No newline at end of file diff --git a/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG.xml b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG.xml new file mode 100644 index 000000000..e07a72d65 --- /dev/null +++ b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG.xml @@ -0,0 +1,34 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + + PG + + + ru + PG + + + + Automatic + + + products
+ sales
+
+
+
\ No newline at end of file diff --git a/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG/Tables/products.xml b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG/Tables/products.xml new file mode 100644 index 000000000..205ef9363 --- /dev/null +++ b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/ExternalDataSources/PG/Tables/products.xml @@ -0,0 +1,130 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + UUID-008 + UUID-009 + + + UUID-010 + UUID-011 + + + UUID-012 + UUID-013 + + + UUID-014 + UUID-015 + + + UUID-016 + UUID-017 + + + + products + + + ru + products + + + + Table + products + + NonobjectData + + ExternalDataSource.PG.Table.products.Field.id + + + + + + true + false + + Auto + Begin + Directly + Auto + + + + + + + + + + + + false + false + Auto + + InDialog + + + Automatic + + + + + id + + + ru + id + + + + + xs:decimal + + 10 + 0 + Any + + + false + + + + false + + false + false + + + false + 0 + DontCheck + + + Auto + Auto + Auto + + id + false + false + + + +
+
\ No newline at end of file diff --git a/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Languages/Русский.xml b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Languages/Русский.xml new file mode 100644 index 000000000..37c60d786 --- /dev/null +++ b/tests/skills/cases/meta-edit/snapshots/eds-add-table-twice/Languages/Русский.xml @@ -0,0 +1,16 @@ + + + + + Русский + + + ru + Русский + + + + ru + + + \ No newline at end of file