🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Guard initializeTheme() call so it can't crash pages missing theme.js
Sassan72f2cef89b81
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 830b83a..4507e95 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,8 @@## 1.0.3 - 2026-05-18### Fixed+- **Theme init crash on every page loading the classic script:** `script.js` called `initializeTheme()` unguarded on `DOMContentLoaded`, but `js/lib/theme.js` (the only file defining it) is never included as a classic script — it is an ES module loaded only via `js/index.js`. The call threw `initializeTheme is not defined` on about, status, register, and both reset-password pages (and index), which also silently skipped the rest of that init handler (`setupUIEventListeners()`, `setupModalTriggers()`, form wiring). The call is now guarded with `typeof initializeTheme === 'function'`; the visual theme was and is applied by `theme-loader.js` on all pages.+ - _Files: `frontend/script.js`- **Paperless "Test Connection" ignored unsaved form values:** Clicking "Test Connection" on the settings page with a freshly entered URL and API token always reported "Connection Failed!", even when the Paperless-ngx instance was reachable, because `POST /api/paperless/test` ignored the `url`/`api_token` in the request body and only ever tested the saved site settings. The endpoint now tests the provided values directly when both are present, and falls back to the saved settings otherwise.- _Files: `backend/file_routes.py`- **Font Awesome now served locally (works offline):** The icon font was loaded from the cdnjs CDN, so all UI icons disappeared on offline or restricted networks. Font Awesome Free 7.0.1 (`all.min.css` + webfonts, ~312 KB) is now vendored under `frontend/vendor/fontawesome/` and referenced by all 8 pages; added `font/woff2`, `font/woff`, and `font/ttf` MIME types to `nginx.conf`.diff --git a/frontend/script.js b/frontend/script.jsindex 58e1b37..1239f53 100644--- a/frontend/script.js+++ b/frontend/script.js@@ -3347,8 +3347,10 @@ document.addEventListener('DOMContentLoaded', function() {initTagFunctionality(); // Initialize tag search/selection}- // Initialize theme (should be safe on all pages)- initializeTheme();+ // Initialize theme (safe on all pages: js/lib/theme.js is not included everywhere)+ if (typeof initializeTheme === 'function') {+ initializeTheme();+ }// Set up event listeners for other UI controls (should contain checks)setupUIEventListeners();