Forums Bug Reports Thread

Photo album delete/share/tag flows use native confirm() and alert() (banned dialogs)

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

Area: Files, photos, gallery, ansi (audit p5) · Surface: /photos/album/{id} (album detail + lightbox) · Dimension: native-dialogs · Severity: major

Multiple native confirm()/alert() calls across the per-tile delete, lightbox delete, share-to-feed, and photo-tagging paths. All are banned by the Engineering Law and have ready replacements (App.modal.confirm for the destructive confirms, App.toast for the error notices). Native dialogs ignore the theme, are unstyled, and degrade the polished lightbox experience the rest of the file works hard to build.

Evidence

platform/templates/photos/album.php:661 `if (!confirm('Delete this photo? This removes it from the album.')) return;`; :670/:673 `alert('Could not delete the photo.')` / `alert('Network error.')`; :1131 `if (!confirm('Delete this photo? ... permanently.')) return;`; :983 `alert((d && (d.message||d.error)) || 'Could not share photo.')`; :987 `alert('Network error sharing photo.')`; :1348/:1360 tag-error `alert(...)`. App.modal.confirm + App.toast already exist (public/js/app.min.js:17, :12).

Suggested fix. Swap the two delete confirm() calls for App.modal.confirm('Delete photo', '...', onConfirm). Replace every alert() with App.toast(msg, 'error'). Keep the existing fetch logic in the onConfirm callback.

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.

Replaced both native confirm() delete calls (tile delete + lightbox delete) with App.modal.confirm('Delete photo', '...', onConfirm), moving the existing fetch logic into the onConfirm callback; captured openItemId into a local deleteItemId for the now-async lightbox handler since the close listener nulls openItemId. Replaced all alert() calls (tile delete, lightbox delete, share-to-feed, and photo-tag) with App.toast(msg, 'error'). php -l clean; no native confirm/alert/prompt remain.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.