Skip to content

Fix/new category crash 10772#10794

Open
Learnobug wants to merge 1 commit intohcengineering:developfrom
Learnobug:fix/new-category-crash-10772
Open

Fix/new category crash 10772#10794
Learnobug wants to merge 1 commit intohcengineering:developfrom
Learnobug:fix/new-category-crash-10772

Conversation

@Learnobug
Copy link
Copy Markdown

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.

@huly-github-staging
Copy link
Copy Markdown

Connected to Huly®: UBERF-16342

…ing hcengineering#10772

Signed-off-by: Learnobug <gunjanaggarwal12345@gmail.com>
@Learnobug Learnobug force-pushed the fix/new-category-crash-10772 branch from db9d502 to cc1fa62 Compare April 22, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant