diff --git a/options/options.js b/options/options.js index ace04fe..b90b6cc 100644 --- a/options/options.js +++ b/options/options.js @@ -19,7 +19,17 @@ var ThemeOptions = function () { "general_inherit": 1 } - var optionCssFiles = JSON.parse($('#optionCssFiles').val()); + // THEME FIX: on the GLOBAL theme-options page the hidden #optionCssFiles can + // hold the literal string "inherit" (not JSON) — an unguarded JSON.parse then + // throws inside this constructor, so run() never executes: no change handlers + // and no save handler get bound, and Save silently posts the stale options + // JSON (nothing changed in the UI is saved). Fall back to an empty file list. + var optionCssFiles; + try { + optionCssFiles = JSON.parse($('#optionCssFiles').val()); + } catch (e) { + optionCssFiles = { add: [], replace: [], remove: [] }; + } //get the global form var globalForm = $('.action_update_options_string_form'); diff --git a/options/options.twig b/options/options.twig index 41f4901..65ed7b6 100644 --- a/options/options.twig +++ b/options/options.twig @@ -43,7 +43,7 @@ heuristically cached copy (the file has only Last-Modified/ETag, no Cache-Control). Re-register it with a version token: bump OPTIONS_JS_TOKEN below whenever options/options.js changes, so every browser fetches the new file once. #} -{% set OPTIONS_JS_TOKEN = '20261125.3' %} +{% set OPTIONS_JS_TOKEN = '20261125.4' %} {{ unregisterScriptFile(optionsPath ~ '/options.js') }} {{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}