From cd1e540cca157d7b7b7ccfda521de3ec13372b91 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Tue, 3 Dec 2024 13:40:26 -0800 Subject: [PATCH] fix: Disable newly created function call blocks when the corresponding definition is disabled. (#8665) --- blocks/procedures.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blocks/procedures.ts b/blocks/procedures.ts index bf9a9206b..20d8fa36b 100644 --- a/blocks/procedures.ts +++ b/blocks/procedures.ts @@ -1099,6 +1099,14 @@ const PROCEDURE_CALL_COMMON = { xml.appendChild(block); Xml.domToWorkspace(xml, this.workspace); Events.setGroup(false); + } else if (!def.isEnabled()) { + this.setDisabledReason( + true, + DISABLED_PROCEDURE_DEFINITION_DISABLED_REASON, + ); + this.setWarningText( + Msg['PROCEDURES_CALL_DISABLED_DEF_WARNING'].replace('%1', name), + ); } } else if (event.type === Events.BLOCK_DELETE) { // Look for the case where a procedure definition has been deleted,