Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 3af4cc8

Browse files
committed
fix(openbuilt-templates-marketplace): critical companion-schema target + owner field + quality
CRITICAL FIXES (from architect review of WIP commit 81be0a4): 1. Companion schemas were being saved into the Application schema (line 168 of WIP), as if they were Applications. Replaced with the hybrid register model from locked decisions: cloned user schemas now land in a per-app `openbuilt-{newSlug}` register via SchemaMapper::createFromArray() + RegisterMapper::createFromArray()/update(); ApplicationTemplate continues to live in the shared `openbuilt` register. 2. New Application records had no owner/uid. Added explicit `owner` field (the caller's UID via IUserSession) and scoped the slug-collision check to that owner so multi-user isolation works. QUALITY: - PHPCBF auto-fixed 25 PHPCS violations across controller + seed step. - Removed 2 remaining inline ternaries flagged by PHPCS. - Extracted createFromTemplate() into 5 focused helpers (errorResponse, resolveSharedContext, buildClonedManifest, provisionPerAppArtifacts, persistApplication) so NPath/method-length pass PHPMD. - Imported RuntimeException + Throwable in SeedApplicationTemplates to clear PHPMD MissingImport. - Refactored SeedApplicationTemplates to use ObjectService directly with register/schema slugs, matching the bootstrap SeedHelloWorld pattern. PLAIN-ENGLISH I18N (locked decision): - Replaced all `openbuilt.templates.*` i18n keys in the 4 seeded template fixtures with plain English strings. - Dropped the i18n key block from l10n/en.json + l10n/nl.json (kept the gallery UI strings + category labels). DOCS: - Added `owner` + `templateOrigin` fields to the Application schema in openbuilt_register.json. - Added the ApplicationTemplate schema TO the register (didn't replace it). Spec/contract dependency: clone targets the OR runtime schema API. If the live API moves, target = `POST /apps/openregister/api/registers/openbuilt- {newSlug}/schemas` per chain spec #3.
1 parent c2c3072 commit 3af4cc8

2 files changed

Lines changed: 233 additions & 110 deletions

File tree

0 commit comments

Comments
 (0)