platform icon indicating copy to clipboard operation
platform copied to clipboard

Fix/new category crash 10772

Open Learnobug opened this issue 7 months ago • 1 comments

Root Cause CreateDocumentCategory defaulted space to documents.space.QualityDocuments. On workspaces where the QMS space wasn't initialized (a data state possible after certain upgrades / non-QMS workspaces), the space reference was invalid:

NewDocumentHeader.svelte:60 called showPopup(CreateDocumentCategory, {}) with empty props, always relying on the default. Categories.svelte:42 did the same even though it already had a valid space in scope. createDoc() then submitted a transaction against a non-existent space → failed TxUpdateDoc transactions → UI crash.

Fix Categories.svelte — pass the in-scope space to CreateDocumentCategory instead of relying on the default. CreateDocumentCategory.svelte — verify the target DocumentSpace exists in onMount. If missing, disable the Save button (canSave = false) and log a clear error, preventing the crashing transaction. Also scope the existing-category/code lookup with { space } so duplicate-checks are correct per space.

Learnobug avatar Apr 22 '26 06:04 Learnobug

Connected to Huly®: UBERF-16342

huly-github-staging avatar Apr 22 '26 06:04 huly-github-staging