From e982f503951a4c87e2df1897f40ba52f369dc5eb Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 6 Jun 2026 14:20:12 +0200 Subject: [PATCH] fix(furni-editor): guard name editing when furni has no furnidata entry ~1.4k items_base rows (pets, custom items) have no matching furnidata classname, so saving their name returned the cryptic server error 'Classname not found in furnidata'. Detect this client-side via the resolved furniDataEntry (entry + classname match) and, when absent, hide the Display Name/Description inputs + Save behind a clear 'NO FURNIDATA' notice instead of letting the save fail. In-furnidata furni (~97.6%) are unchanged. --- .../views/FurniEditorEditView.tsx | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/src/components/furni-editor/views/FurniEditorEditView.tsx b/src/components/furni-editor/views/FurniEditorEditView.tsx index 60bd81c..ca434e0 100644 --- a/src/components/furni-editor/views/FurniEditorEditView.tsx +++ b/src/components/furni-editor/views/FurniEditorEditView.tsx @@ -199,6 +199,19 @@ export const FurniEditorEditView: FC = props => const isValid = useMemo(() => Object.keys(validation).length === 0, [ validation ]); + // Furnidata name editing only works when the furni has a matching furnidata + // entry: the server writer is edit-only and refuses classnames absent from + // furnidata (pets, custom items, …). furniDataEntry is the entry resolved by + // the server (by id); guard on it + a classname match so we never trigger the + // cryptic "Classname not found in furnidata" error on save. + const furnidataEditable = useMemo(() => + { + if(!furniDataEntry) return false; + const cn = String((furniDataEntry as { classname?: unknown }).classname ?? '').trim().toLowerCase(); + const itemCn = String(item?.itemName ?? '').trim().toLowerCase(); + return cn ? (cn === itemCn) : true; + }, [ furniDataEntry, item ]); + const handleSave = useCallback(() => { if(!isValid) return; @@ -267,24 +280,35 @@ export const FurniEditorEditView: FC = props =>
Display name & description - LIVE - { (furniName !== String(furniDataEntry?.name ?? '') || furniDescription !== String(furniDataEntry?.description ?? '')) && + { furnidataEditable + ? LIVE + : NO FURNIDATA } + { furnidataEditable && (furniName !== String(furniDataEntry?.name ?? '') || furniDescription !== String(furniDataEntry?.description ?? '')) && Unsaved }
-
-
- - setFurniName(e.target.value) } maxLength={ 256 } /> + { furnidataEditable ? ( + <> +
+
+ + setFurniName(e.target.value) } maxLength={ 256 } /> +
+
+ + setFurniDescription(e.target.value) } maxLength={ 256 } /> +
+
+ + + + + + ) : ( +
+ + This furni has no matching furnidata entry (e.g. a pet or custom item), so its display name can't be edited here. Clients fall back to the DB Public Name below.
-
- - setFurniDescription(e.target.value) } maxLength={ 256 } /> -
-
- - - - + ) }