Info Notice Page Modernized - sebiboga/testlink-upgraded GitHub Wiki
Legacy renderer gui/templates/dashio/workAreaSimple.tpl, produced by three
standalone callers that had no modern twin (sibling of the #1895 Error page).
With the TODO ledger empty and every ASIDE entry already mapped to a modern
.html + BFF, the last standalone full-page feedback renderer left was
workAreaSimple.tpl. It is emitted by:
-
Fatal database connection failure —
doDBConnect($db, true)(lib/functions/common.php), titlefatal_page_title("TestLink ::: Fatal Error") + the DB host/name/error text. Reached by any page load while the DB is unreachable (itstLogredirects there when$onErrorExitis set). -
Report document error —
displayInfo()(lib/functions/info.inc.php:29), called fromlib/results/displayMgr.php(three guards: unknown test plan, missingtplan_idon an API-key request, missingtproject_id), titleerror_print_doc_title+ messageerror_print_doc_missing_testplan. -
Self-registration disabled —
firstLogin.php:23(whenuser_self_signupis off), titlefatal_page_title+ messageerror_self_signup_disabled+ a back-to-login link; reached anonymously before any DB connection.
All three require no session gate (the DB-fail page runs before a session env exists), so an anonymous visitor must be able to open it.
| Layer | File |
|---|---|
| Screen |
gui/templates/feedback/info.html (Dashio standalone HTML/JS/CSS) |
| BFF |
api/info/index.php (GET ?code=<machine-id>[&locale=xx], session-optional, DB-free) |
| Wiring |
redirectToInfoPage() + $actions->infoPage in lib/functions/common.php; displayInfo() (lib/functions/info.inc.php), the doDBConnect() failure path and firstLogin.php redirect here |
| i18n |
info.* (17 keys) + footers.infoPage in all 10 bundles |
-
Message mapping —
db_connect_fail→info.dbFailTitle/info.dbFailMsg;missing_testplan→info.printDocErrorTitle/info.printDocMissingTestplan;signup_disabled→info.signupDisabledTitle/info.signupDisabledMsg; anything else (or none) →generic/info.genericTitle/info.genericMsg. -
Legacy strings preserved — the titles and the
printDoc*/signup*message values are copied verbatim fromlocale/en_US/strings.txt(fatal_page_title,error_print_doc_title,error_print_doc_missing_testplan,error_self_signup_disabled); the other bundles carry the server-catalog translations. The one deliberate exception isinfo.dbFailMsg, a new fixed string that replaces the legacy screen's raw DBMS error text (host/name/driver), which was an information-disclosure surface and is intentionally not reproduced. -
No rights gate — like the legacy page, any visitor may open it; the BFF
returns
auth.logged_inso the screen offers Home to a session holder and Home + Go to Login to an anonymous visitor. -
Deep links —
displayInfo(), the DB-fail path andfirstLogin.phpall 302 togui/templates/feedback/info.html?code=…. TheLocationis path-only — the install root is derived fromTL_ABS_PATHunderDOCUMENT_ROOT(falling back to the sessionbasehrefpath, then the running script's directory), so the link is correct from any folder and, being host-free, is same-origin by construction (no open-redirect surface). - Loading spinner, Retry, locale switcher, footer; a fatal DB failure gets the amber warning glyph, everything else the teal info glyph.
-
?code[]=x(array) and non-[a-z0-9_]code→400 INVALID_CODE(the #1886 / #1893 defect class: never coerced to a sink).- No database access — the page must answer during an outage; it never callsdoDBConnect()/new database(). -
Cache-Control: no-store,X-Content-Type-Options: nosniff, JSON-only. - Non-GET/HEAD →
405 METHOD_NOT_ALLOWED; foreign-origin POST →403viabffSameOriginGuard(). - Stable machine
info_codereturned alongside the localized keys, so callers/tests assert the path without matching English text. - The legacy template rendered the caller
contentun-escaped and the DB failure embedded the raw DBMS error text; the modern page renders fixed localized messages, removing that injection surface.
-
API (20/20 PASS, see
tmp/TLU_Test_Cases.md"Issue #1899"): mapping formissing_testplan/db_connect_fail/signup_disabled/generic, 400 on array/non-token code, 405 same-origin POST, 403 foreign/no-proof POST, HEAD, stale-tplan report 302, DB-downlogin.php302,firstLogin.php302 when self-signup is disabled, 0 Smarty renders ofworkAreaSimple.tplleft,$actions->infoPagepresent, 18 keys × 10 bundles,ai/verify_i18n_coverage.shPASS. -
Browser (headless Chrome):
?code=missing_testplan→ "Document generation error" + legacy message;?code=db_connect_fail→ amber glyph + "TestLink ::: Fatal Error";?code=signup_disabled→ "TestLink ::: Fatal Error" + the self-registration-disabled message;?locale=rofully localized ("TestLink - Notificare"); console clean (only the sharedapi/userinfo401 anon locale probe, same as the Error page). - Event Viewer: 0 new ERROR/WARNING.
- Suite
## Task — Issue #1899appended totmp/TLU_Test_Cases.md; suite gateTLU_REQUIRE_SUITE="Issue #1899" bash ai/verify_test_suites.shPASS.
-
docs/1899-info-missing-testplan.png— report document error notice. -
docs/1899-info-db-fail.png— fatal DB connection failure notice. -
docs/1899-info-signup-disabled.png— self-registration-disabled notice. -
docs/1899-info-ro.png— Romanian locale.
