Forums Bug Reports Thread

Native confirm() in learn path editor — banned dialog, breaks theme, regresses canonical pattern

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

Area: Admin plane (audit p12) · Surface: /admin/learn/paths/{id}/edit · Dimension: native-dialogs · Severity: major

The path-item delete uses a native browser confirm(), which is on the banned list. It looks like malware, ignores the site theme, and is the lone holdout in an admin where every other destructive action already uses the data-confirm/App.modal pattern.

Evidence

platform/templates/learn/admin/paths/edit.php:153-154 — `<form ... action="/admin/learn/paths/<?= $pid ?>/items/<?= (int) $it['id'] ?>/delete" ... onsubmit="return confirm('Remove this item from the path?');">`. Native confirm()/alert()/prompt() are explicitly banned (use App.modal/data-confirm). Every OTHER delete in the same admin uses data-confirm (e.g. platform/templates/learn/admin/courses/modules/edit.php:88 `data-confirm="Delete module ..."`, questions/edit.php:14, team.php:63). The global handler exists and works: platform/public/js/app.min.js:49 `document.addEventListener('click',function(e){var btn=e.target.closest('[data-confirm]');...App.modal.confirm('Confirm',message,...)})`.

Suggested fix. Remove the onsubmit="return confirm(...)" and add data-confirm="Remove this item from the path?" to the <form>, matching the pattern already used in modules/edit.php, questions/edit.php, and team.php.

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.

Same delete form already uses data-confirm="Remove this item from the path?" on the <form> and has no onsubmit="return confirm(...)" handler. The prescribed replacement is already present; grep confirms zero native dialog calls in the file.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.