Skip to content

Task Issue 992 Delete Legacy ProjectView

sebiboga edited this page Nov 29, 2026 · 1 revision

Task Issue #992 — Delete legacy projectView (Refs #986)

Status: implemented on task/issue-992, verified locally against the repo's MariaDB fixture (127.0.0.1:3307) and PHP 8.4.28 built-in server.

Why the two-file deletion was not enough

The issue named lib/project/projectView.php and gui/templates/dashio/project/projectView.tpl. A pre-change grep found 121 projectView matches, of which three were live and would break if only those two files were removed:

  1. lib/project/projectEdit.php:120-125 rendered projectView.tpl after every successful legacy doCreate / doDelete / doUpdate / setActive / setInactive / enableRequirements / disableRequirements write. The file itself must stay (issue text: held under #967), so the template could not be deleted until that flow had a different destination.
  2. lib/functions/testproject.class.php:4831-4833 built searchAction and displayListURL for the legacy controller. getViewActions() is still called by projectEdit.php:739, and displayListURL feeds the Cancel button of the still-live gui/templates/dashio/project/projectEdit.tpl:290.
  3. gui/templates/dashio/testcases/containerView.tpl:172 linked the test project name to the legacy controller (rendered through lib/testcases/containerEdit.php).

Template resolution was confirmed: lib/functions/tlsmarty.inc.php:101-110 pins Smarty's main template dir to gui/templates/dashio/, and common.php:1109-1125 derives project/ from SCRIPT_NAME, so the ambiguous projectView.tpl name resolves to the dashio twin — not the tl-classic one. $tlCfg->gui->ux = 'tl-classic' (config.inc.php:161) has no reader.

Changes

File Change
lib/project/projectView.php DELETED (legacy controller, mgt_modify_product check + list/search; modern api/projects already enforces the same right on every route)
gui/templates/dashio/project/projectView.tpl DELETED (legacy DataTables list)
gui/templates/tl-classic/project/projectView.tpl DELETED (orphaned theme twin, per #984/#966/#947 precedent)
lib/project/projectEdit.php Successful legacy writes now redirect() to gui/templates/projectsView.html instead of rendering the removed template; the now-unreachable legacy list-render block (and its undefined $add*Tracker variables) removed; a silent create() failure no longer counts as success; stale $op->template assignment removed
lib/functions/testproject.class.php getViewActions() now emits the modern screen for searchAction / displayListURL; the unused $environment string removed
lib/functions/common.php #992 note on $actions->projectView corrected (legacy controller no longer exists)
gui/templates/dashio/testcases/containerView.tpl project link → gui/templates/projectsView.html
gui/templates/dashio/testcases/include/testprojectView.inc.tpl same retarget (dead include, kept consistent)
gui/templates/dashio/content.tpl same retarget (dead include, kept consistent)
gui/templates/tl-classic/mainPageLeft.tpl, testcases/containerView.tpl, project/projectEdit.tpl same retarget in the unused classic theme so no dangling URL remains anywhere in the tree

Kept deliberately: lib/project/projectEdit.php + gui/templates/dashio/project/projectEdit.tpl (explicitly held under #967). Also accepted explicitly: the old template's doViewReload navbar refresh after legacy writes is not reproduced — no live UI reaches that form any more, and the modern screen/BFF already behaves the same way.

Left deliberately: $tlCfg->gui->projectView->pagination (config.inc.php) and [projectView] in gui/templates/conf/input_dimensions.conf — no reader remains after the deletion, but the same dead config was reported-and-kept in #976, so it is not part of this cleanup. Historical docs/wikis and locale section comments that mention the removed files are provenance, not links, and are likewise left untouched.

Verification (measured)

  • php -l lib/functions/testproject.class.php, php -l lib/project/projectEdit.php, php -l lib/functions/common.php → No syntax errors detected.
  • grep -n 'projectView.php\|projectView.tpl' after the change → only docs, CHANGELOG, locale section comments and projectsView.html parity comments remain; zero live PHP/URL/template references.
  • HTTP against http://127.0.0.1:8083: legacy controller 404, both template paths 404, gui/templates/projectsView.html 200, gui/templates/dashio/project/projectEdit.tpl 200 (still URL-addressable), api/projects/index.php list 200 with the project payload.
  • Legacy edit flow with a temporary project ZZ992CleanupProbe (BFF id 1899): GET projectEdit.php?doAction=create → 200, Cancel button calls location.href=fRoot+'gui/templates/projectsView.html'; doAction=setInactive and setActive both returned <script>location.href='.../gui/templates/projectsView.html'</script> and no Smarty error; fixture deleted again through the BFF (0 rows left).
  • Browser (headless Chromium via chrome-devtools MCP): modern screen renders the DataTables grid (1 seeded project, 8 columns, footer "Showing 1 to 1 of 1 entries"); legacy URL renders the browser's 404 page; clicking Cancel on the legacy create form navigates to projectsView.html. Console shows only the two pre-existing generic warnings (label/for and form-field id), unrelated to this cleanup. Screenshot: docs/screenshots/issue-992-projectsview-after-cleanup.png.
  • Event Viewer table: all rows from the test window are log_level=16 (AUDIT: login + fixture create/delete); 0 Error, 0 Warning rows.
  • Code review (subagent, rule 16): APPROVE, no must-fix items. Both helpful notes were applied — dead post-redirect render block removed, and a silent create() failure now keeps status_ok=0 so it cannot masquerade as a successful redirect. Re-ran php -l and the fixture create/toggle/delete cycle after those edits: redirect still correct, fixture rows back to 0.

Resume

cd /home/sebi/testlink
git checkout task/issue-992
php -S 127.0.0.1:8083 -t . &
# login admin/admin, then:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8083/lib/project/projectView.php           # 404
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8083/gui/templates/projectsView.html       # 200
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8083/lib/project/projectEdit.php?doAction=create  # 200

Screenshot

projectsView.html after the #992 cleanup

Clone this wiki locally