From 701130bb44f1dab9898bb395c5bf326ec193d531 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 30 Sep 2025 11:25:53 +0200 Subject: [PATCH] Fix: Extract object ID if URL is returned (#5596) --- packages/frontend-2/lib/object-sidebar/helpers.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend-2/lib/object-sidebar/helpers.ts b/packages/frontend-2/lib/object-sidebar/helpers.ts index f2ac41792..8cab038fb 100644 --- a/packages/frontend-2/lib/object-sidebar/helpers.ts +++ b/packages/frontend-2/lib/object-sidebar/helpers.ts @@ -99,6 +99,13 @@ export function getTargetObjectIds(object: Record | SpeckleObje .filter((id) => !!id && typeof id === 'string') } // Handles both actual collection objecs( ala IFC) and individual objects - if (object.id && typeof object.id === 'string') return [object.id] + if (object.id && typeof object.id === 'string') { + // Extract object ID from URL if it's a full URL + // or return the ID as-is if it's already just an object ID + const objectId = object.id.includes('/objects/') + ? object.id.split('/').reverse()[0] + : object.id + return [objectId] + } return [] }