Repository navigation
Modernize Bug Delete Popup bugDelete
The standalone Bug Delete popup — lib/execute/bugDelete.php (+
gui/templates/dashio/execute/bugDelete.tpl, an 81-line action popup) — is
modernized as a standalone Dashio screen backed by a REST BFF. It unlinks a bug
from a test execution and is opened from the Execute Tests / Set Results bug
list via deleteBug().
The TODO section of docs/MODERNIZATION-STATUS.md is empty: every ASIDE
entry was already verified to map to a modern gui/templates/**/*.html screen +
BFF. Per the modernize.yml guidance ("pick the smallest coherent one"), the
Bug Delete popup was chosen — it was the only lib/execute/* controller with no
modern twin (the modern screens inline bug-link/unlink in execTest /
execSetResults but expose no dedicated unlink screen, and bugAdd.php,
bugLink.php, bugCreate.php still serve the add/create flows).
-
Screen:
gui/templates/execute/bugDelete.html— Dashio popup: teal header ("Bug Delete"), Close button, context cardExecution #<id> — <test case>(test case / test plan / test project / build / platform / status badge / executed-on), a Bugs linked to this execution bug list (bug id,Step #Nlabel for step-level links, per-row Delete button). The Delete button opens a Bootstrap confirm modal ("Unlink this bug from the execution?" with the bug id); confirming POSTs to the BFF and re-renders: success box + empty state. Dedicated state boxes for load errors (missing/invalid id), execution not found, and permission denied. TLi18n locale switcher + localized footer. -
BFF:
api/bugdelete/index.php—GET ?action=init&exec_id=N [&tcstep_id=N][&bug_id=X]returns the execution context + linked bugs; whenbug_idis present the row is deleted on the way in — exact legacy parity (lib/execute/bugDelete.php:44write_execution_bug($db, 'delete', ...)deletes on load).POST ?action=delete {exec_id, tcstep_id, bug_id}deletes the row and writes theaudit_executionbug_deleted/audit_executionbug_deleted_no_platformevents. Rights:testplan_executeon the owning project (not the session-context preview) → 403; anon → 401; bad/missing exec or bug → 400; unknown execution → 404; non-GET → 405; unknown action → 400; CSRFbffSameOriginGuard. -
Link switch:
deleteBug()ingui/javascript/testlink_library.jsnow opensgui/templates/execute/bugDelete.html?exec_id=&tproject_id=&tplan_id=&bug_id=. -
Shim:
lib/execute/bugDelete.phpis kept as a session-guarded 302 redirect onto the modern screen (anon → login), so legacy deep links still resolve. -
i18n:
bugdel.*(24 keys) +footers.bugDeletein all 10 bundles (en/ro/de/es/fr/it/ja/pt/ru/zh), validated withpython3 -m json.tool.
- Browser (admin session): list view renders the context card + BUG-101 row;
step-level link renders
BUG-202+Step #1; Delete → confirm modal → POST → success box "The bug was successfully deleted!" + empty state;?exec_id=99999→ "Execution not found"; noexec_id→ "Missing or invalid execution id."; locale switch torore-renders fully in Romanian (Ștergere Bug / Buguri legate de această execuție / Șterge); screen also opens with?exec_id=alone (the BFF resolves the project from the execution). - BFF curl contract: 401 anon, 403 role-3 no-rights user (
norights), 405 wrong method, 400 missing/invalid exec + missing bug_id on POST, 404 unknown execution, 403 CSRF (noX-Requested-With), 200 init / auto-delete / delete. - Legacy on-load auto-delete parity verified (GET with
bug_iddeletes). - Event Viewer clean after the run (only audit/login rows, no Error/Warning);
console clean;
php -lclean.
- Schema parity:
execution_bugshas the composite PK(execution_id, bug_id, tcstep_id)and noidcolumn, so the initial post-delete re-checkSELECT id …threw SQL error 1054 → HTTP 500. Fixed toSELECT execution_id(commit5b4172bf4).
Suite 1559 (Screen — Bug Delete popup) in tmp/TLU_Test_Cases.md —
10/10 PASS.
Screenshots: docs/screenshots/issue-1559-bugdelete-list.png,
docs/screenshots/issue-1559-bugdelete-modal.png,
docs/screenshots/issue-1559-bugdelete-success-empty.png,
docs/screenshots/issue-1559-bugdelete-404.png.
Fixture: tmp/fixtures_1559.php (project B1559, TC "BUG Login Check", 3
executions: with a linked bug / step-level bug / empty). No-rights user:
tmp/mkuser_norights.php (role 3).