From 6da2059b8c4d4e30aa1cb19f8134b995635ea591 Mon Sep 17 00:00:00 2001 From: Chuck Date: Sun, 4 Jan 2026 20:20:32 -0500 Subject: [PATCH] Use window. prefix for array-of-objects JavaScript functions Explicitly use window.addArrayObjectItem, window.removeArrayObjectItem, etc. in the template to ensure the functions are accessible from inline event handlers. Also add safety checks to prevent errors if functions aren't loaded yet. --- web_interface/templates/v3/partials/plugin_config.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web_interface/templates/v3/partials/plugin_config.html b/web_interface/templates/v3/partials/plugin_config.html index 8264645d..aecf9ba2 100644 --- a/web_interface/templates/v3/partials/plugin_config.html +++ b/web_interface/templates/v3/partials/plugin_config.html @@ -97,7 +97,7 @@ id="{{ prop_field_id }}_file" accept="{{ allowed_types|join(',') }}" style="display: none;" - onchange="handleArrayObjectFileUpload(event, '{{ field_id }}', {{ item_index }}, '{{ prop_key }}', '{{ plugin_id_from_config }}')"> + onchange="if (typeof window.handleArrayObjectFileUpload === 'function') { window.handleArrayObjectFileUpload(event, '{{ field_id }}', {{ item_index }}, '{{ prop_key }}', '{{ plugin_id_from_config }}'); } else { console.error('handleArrayObjectFileUpload not available'); }"> @@ -123,7 +123,7 @@ data-prop-key="{{ prop_key }}" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded" {% if prop_value %}checked{% endif %} - onchange="updateArrayObjectData('{{ field_id }}')"> + onchange="if (typeof window.updateArrayObjectData === 'function') { window.updateArrayObjectData('{{ field_id }}'); }"> {{ prop_label }} {% else %} @@ -147,7 +147,7 @@