Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ef6bdc823d |
+3
-3
@@ -4,9 +4,9 @@
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Fixed "Reset to Defaults" blanking all settings instead of restoring them** (Issue #149a, branch `bugfix/issue-149a`): "Reset to Defaults" was clearing all fields to empty/false instead of populating them with their actual default values
|
||||
- `resetToDefaults()` now reads from `window.DEFAULT_CONFIG` and restores each field to its proper default, matching the same logic used on initial page load
|
||||
- **Fixed deleting a wish with an owner assigned** (Issue #152, branch `bugfix/issue-152`): Resolved foreign key constraint error when removing a set from the wishlist that had an owner assigned
|
||||
- **Fixed `BK_INSTRUCTIONS_ALLOWED_EXTENSIONS` being treated as a string instead of a list** (Issue #149b, branch `bugfix/issue-149b`): When this setting was saved via the admin panel, it was stored and cast as a plain string rather than a list, causing it to be iterated character by character (e.g. `['.', 'p', 'd', 'f']` instead of `['.pdf']`)
|
||||
- Added `allowed_extensions` to the list-type keyword detection in `_cast_value()`, matching the existing pattern used for `badge_order` settings
|
||||
- **Fixed deleting a wish with an owner assigned** (Issue #152): Resolved foreign key constraint error when removing a set from the wishlist that had an owner assigned
|
||||
- Wish owners are now deleted before the wish itself, respecting the FK constraint
|
||||
|
||||
## 1.4
|
||||
|
||||
@@ -192,7 +192,7 @@ class ConfigManager:
|
||||
def _cast_value(self, var_name: str, value: Any) -> Any:
|
||||
"""Cast value to appropriate type based on variable name"""
|
||||
# List variables (admin sections, badge order) - Check this FIRST before boolean check
|
||||
if any(keyword in var_name.lower() for keyword in ['sections', 'badge_order']):
|
||||
if any(keyword in var_name.lower() for keyword in ['sections', 'badge_order', 'allowed_extensions']):
|
||||
if isinstance(value, str):
|
||||
return [section.strip() for section in value.split(',') if section.strip()]
|
||||
elif isinstance(value, list):
|
||||
|
||||
@@ -285,21 +285,18 @@ function saveLiveConfiguration() {
|
||||
function resetToDefaults() {
|
||||
console.log('Resetting to defaults');
|
||||
|
||||
Object.keys(window.DEFAULT_CONFIG).forEach(varName => {
|
||||
const defaultValue = window.DEFAULT_CONFIG[varName];
|
||||
|
||||
const toggle = document.getElementById(varName);
|
||||
if (toggle && toggle.type === 'checkbox') {
|
||||
toggle.checked = defaultValue === true;
|
||||
// Reset all form inputs
|
||||
document.querySelectorAll('.config-toggle, .config-number, .config-text').forEach(input => {
|
||||
if (input.type === 'checkbox') {
|
||||
input.checked = false;
|
||||
} else {
|
||||
input.value = '';
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelectorAll(`input[data-var="${varName}"]:not(.config-static)`).forEach(input => {
|
||||
if (input.type !== 'checkbox') {
|
||||
input.value = defaultValue !== null && defaultValue !== undefined ? defaultValue : '';
|
||||
}
|
||||
});
|
||||
|
||||
updateConfigBadge(varName, defaultValue);
|
||||
// Update badges
|
||||
Object.keys(window.CURRENT_CONFIG).forEach(varName => {
|
||||
updateConfigBadge(varName, null);
|
||||
});
|
||||
|
||||
// Show status message
|
||||
|
||||
Reference in New Issue
Block a user