From d6c42f2d127f0d340e9b032eea04a5b9bb02fcd6 Mon Sep 17 00:00:00 2001 From: "Beau Beauchamp, WebTigers" Date: Fri, 17 Jul 2026 05:09:52 -0400 Subject: [PATCH 1/2] Fix: dashboard Customize button did nothing (modal created before Bootstrap loaded) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dashboard's inline script runs at parse time (content is at layout line 69), but bootstrap.bundle.js loads in the footer (line 82) — so `new bootstrap.Modal()` ran against an undefined window.bootstrap, modal stayed null, and the click handler was never attached (guarded on `modal`). Create the modal lazily on first click instead, and attach the handler unconditionally. Matches the DOMContentLoaded pattern every other admin modal uses. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 8 ++++++++ core/views/scripts/admin/index.phtml | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe23df8..dcd75fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to **Tiger Core** (`webtigers/tiger-core`). Format follows [Keep a Changelog](https://keepachangelog.com/); this project uses [SemVer](https://semver.org/) — while `0.x`, the public API (`@api`) may still shift between minor versions. +## [Unreleased] + +### Fixed +- **Dashboard "Customize" button did nothing.** The dashboard's inline script runs at parse time, but + Bootstrap's JS loads in the layout footer *after* it — so `new bootstrap.Modal()` was called against an + undefined `window.bootstrap`, leaving the modal null and the click handler unattached. Now the modal is + created lazily on first click (when Bootstrap is loaded), matching how every other admin view does it. + ## [0.13.0-beta] — 2026-07-17 ### Added diff --git a/core/views/scripts/admin/index.phtml b/core/views/scripts/admin/index.phtml index 6e4bb22..71efb85 100644 --- a/core/views/scripts/admin/index.phtml +++ b/core/views/scripts/admin/index.phtml @@ -164,7 +164,8 @@ $t = function ($s) use ($tr) { return $tr ? $tr->translate($s) : $s; }; // --- Customize: per-user widget visibility (WP "Screen Options" style) ------------------------ var custBtn = document.getElementById('dash-customize'); var modalEl = document.getElementById('dash-customize-modal'); - var modal = (window.bootstrap && modalEl) ? new bootstrap.Modal(modalEl) : null; + var modal = null; // created lazily on first click — Bootstrap's JS loads in the layout + // footer, AFTER this inline script, so window.bootstrap isn't defined yet. function itemById(id) { var found = null; @@ -236,8 +237,12 @@ $t = function ($s) use ($tr) { return $tr ? $tr->translate($s) : $s; }; grid.layout(); } - if (custBtn && modal) { - custBtn.addEventListener('click', function () { buildPrefs(); modal.show(); }); + if (custBtn && modalEl) { + custBtn.addEventListener('click', function () { + if (!modal && window.bootstrap) { modal = new bootstrap.Modal(modalEl); } + buildPrefs(); + if (modal) { modal.show(); } + }); } if (modalEl) { modalEl.addEventListener('change', function (e) { From 6542240b972ba87b533f4f443c5e8658bfc9c8f5 Mon Sep 17 00:00:00 2001 From: "Beau Beauchamp, WebTigers" Date: Fri, 17 Jul 2026 05:11:45 -0400 Subject: [PATCH 2/2] release: v0.13.1-beta Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 2 +- library/Tiger/Version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcd75fb..2474be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to **Tiger Core** (`webtigers/tiger-core`). Format follows [Keep a Changelog](https://keepachangelog.com/); this project uses [SemVer](https://semver.org/) — while `0.x`, the public API (`@api`) may still shift between minor versions. -## [Unreleased] +## [0.13.1-beta] — 2026-07-17 ### Fixed - **Dashboard "Customize" button did nothing.** The dashboard's inline script runs at parse time, but diff --git a/library/Tiger/Version.php b/library/Tiger/Version.php index a88129a..b99e6db 100644 --- a/library/Tiger/Version.php +++ b/library/Tiger/Version.php @@ -9,5 +9,5 @@ class Tiger_Version { /** Current Tiger Core version. Keep in lockstep with the git tag cut for a release. */ - const VERSION = '0.13.0-beta'; + const VERSION = '0.13.1-beta'; }