Forums Bug Reports Thread

Banned native window.confirm() in events bulk-action handler

Patrick Bass · Jun 6 · 12 · 1 Locked
[Major] [High Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 6:54pm

Area: Engagement (audit p9) · Surface: /admin/events (bulk approve/delete) · Dimension: native-dialogs · Severity: major

The bulk approve/delete action in the admin events queue triggers a native browser confirm dialog. Native confirm/alert/prompt are banned platform-wide. It breaks the dark/amber/light themes and is jarring next to the rest of the admin UI, which uses App.modal. The data-confirm copy is already authored on the <option> elements — only the JS that consumes it is wrong.

Evidence

platform/templates/events/admin.php:511 `if (!window.confirm(msg)) return;` inside runBulk(). The same file already defines data-confirm strings on the bulk options (admin.php:431-432: `<option value="approve" data-confirm="Approve all selected events?...">`) and on per-row delete (admin.php:231), but the bulk runner reads `opt.dataset.confirm` and then funnels it through native window.confirm instead of App.modal.confirm.

Suggested fix. Replace `if (!window.confirm(msg)) return;` with `App.modal.confirm('Confirm', msg, function(){ /* existing fan-out body */ });` and move the bulk POST logic into the onConfirm callback. App.modal.confirm is already loaded globally (app.min.js:17).

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 5:15am

Resolved — fixed and deployed. Commit e23a8fec596a, shipped dev-first then to all tenants on 2026-06-06.

The /admin/events bulk approve/delete handler already uses App.modal.confirm('Confirm', msg, doBulk) instead of window.confirm, with all the bulk POST fan-out logic moved into the doBulk onConfirm callback (lines 500-560) plus a defensive fallback. No window.confirm remains; the only 'confirm' occurrences are the explanatory comment (line 512) and the correct App.modal.confirm call (line 555). php -l passes.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.