Fix/plugins manager syntax error (#192)

* chore: Update basketball-scoreboard submodule for odds font fix

* fix(plugins): Add missing closing brace in file-upload widget if block

Fixed syntax error where the if statement starting at line 2949 was missing
its closing brace before the else if statement. This caused 'Unexpected token
else' error at line 3257 when parsing the loadCustomHtmlWidget function.

The fix adds the missing closing brace at line 3048 to properly close the
if block before the else if chain continues.

* fix(plugins): Resolve unmatched else if syntax error in plugins_manager.js

- Fixed indentation of else if chain for custom-feeds widget (line 3203)
- Fixed indentation of final else block (line 3240)
- Added missing closing brace to properly close array handling block (line 3257)
- Resolves 'Unexpected token else' syntax error at line 3257
- Allows plugin store to load correctly

* fix: Update plugins_manager.js cache-busting version to force reload of syntax fix

---------

Co-authored-by: Chuck <chuck@example.com>
This commit is contained in:
Chuck
2026-01-16 15:43:18 -05:00
committed by GitHub
parent fadcf0f407
commit 23ada60544
2 changed files with 5 additions and 5 deletions

View File

@@ -3164,8 +3164,7 @@ function generateFieldHtml(key, prop, value, prefix = '') {
data-file-type="${fileType}"> data-file-type="${fileType}">
</div> </div>
`; `;
} } else if (xWidgetValue === 'checkbox-group' || xWidgetValue2 === 'checkbox-group') {
} else if (xWidgetValue === 'checkbox-group' || xWidgetValue2 === 'checkbox-group') {
// Checkbox group widget for multi-select arrays with enum items // Checkbox group widget for multi-select arrays with enum items
// Use _data hidden input pattern to serialize selected values correctly // Use _data hidden input pattern to serialize selected values correctly
console.log(`[DEBUG] ✅ Detected checkbox-group widget for ${fullKey} - rendering checkboxes`); console.log(`[DEBUG] ✅ Detected checkbox-group widget for ${fullKey} - rendering checkboxes`);
@@ -3201,7 +3200,7 @@ function generateFieldHtml(key, prop, value, prefix = '') {
// Sentinel hidden input with bracket notation to allow clearing array to [] when all unchecked // Sentinel hidden input with bracket notation to allow clearing array to [] when all unchecked
// This ensures the field is always submitted, even when all checkboxes are unchecked // This ensures the field is always submitted, even when all checkboxes are unchecked
html += `<input type="hidden" name="${fullKey}[]" value="">`; html += `<input type="hidden" name="${fullKey}[]" value="">`;
} else if (xWidgetValue === 'custom-feeds' || xWidgetValue2 === 'custom-feeds') { } else if (xWidgetValue === 'custom-feeds' || xWidgetValue2 === 'custom-feeds') {
// Custom feeds widget - check schema validation first // Custom feeds widget - check schema validation first
const itemsSchema = prop.items || {}; const itemsSchema = prop.items || {};
const itemProperties = itemsSchema.properties || {}; const itemProperties = itemsSchema.properties || {};
@@ -3238,7 +3237,7 @@ function generateFieldHtml(key, prop, value, prefix = '') {
<p class="text-sm text-gray-600 mt-1">Enter values separated by commas (custom feeds table rendered server-side)</p> <p class="text-sm text-gray-600 mt-1">Enter values separated by commas (custom feeds table rendered server-side)</p>
`; `;
} }
} else { } else {
// Regular array input (comma-separated) // Regular array input (comma-separated)
console.log(`[DEBUG] ❌ No special widget detected for ${fullKey}, using regular array input`); console.log(`[DEBUG] ❌ No special widget detected for ${fullKey}, using regular array input`);
// Handle null/undefined values - use default if available // Handle null/undefined values - use default if available
@@ -3254,6 +3253,7 @@ function generateFieldHtml(key, prop, value, prefix = '') {
<input type="text" id="${fullKey}" name="${fullKey}" value="${arrayValue}" placeholder="Enter values separated by commas" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm bg-white text-black placeholder:text-gray-500"> <input type="text" id="${fullKey}" name="${fullKey}" value="${arrayValue}" placeholder="Enter values separated by commas" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm bg-white text-black placeholder:text-gray-500">
<p class="text-sm text-gray-600 mt-1">Enter values separated by commas</p> <p class="text-sm text-gray-600 mt-1">Enter values separated by commas</p>
`; `;
}
} }
} else if (prop.enum) { } else if (prop.enum) {
html += `<select id="${fullKey}" name="${fullKey}" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm bg-white text-black">`; html += `<select id="${fullKey}" name="${fullKey}" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm bg-white text-black">`;

View File

@@ -4920,7 +4920,7 @@
<script src="{{ url_for('static', filename='v3/js/widgets/plugin-loader.js') }}" defer></script> <script src="{{ url_for('static', filename='v3/js/widgets/plugin-loader.js') }}" defer></script>
<!-- Legacy plugins_manager.js (for backward compatibility during migration) --> <!-- Legacy plugins_manager.js (for backward compatibility during migration) -->
<script src="{{ url_for('static', filename='v3/plugins_manager.js') }}?v=20250104i" defer></script> <script src="{{ url_for('static', filename='v3/plugins_manager.js') }}?v=20250116a" defer></script>
<!-- Custom feeds table helper functions --> <!-- Custom feeds table helper functions -->
<script> <script>