Repository navigation
Bugfix Issue 2130 Authored Maintainability Chapter
Chapter 28 (Non-Functional: Maintainability / Maintainability & Portability) was a
read-only reference page. On a freshly imported 2.0.1 database with project 1
(Strategy Fixture 2130, prefix SF2130) the editor
gui/templates/strategy/nfrMaintainability.html?tproject_id=1 returned HTTP 200 but the
DOM contained 0 textareas and 0 buttons, no BFF request was made, and
GET /api/strategyreport/index.php?action=init&tproject_id=1 had no chapter-text key.
There was no way to author project-specific text, and therefore nothing for the Test
Strategy report to aggregate or print.
The chapter pages are static Dashio HTML fragments (issue #1052/#1462 family) and were
never given a persistence path, unlike the nine sections of the authored strategy
document (api/strategydoc/index.php, issue #1943/#2101):
-
gui/templates/strategy/nfrMaintainability.html:40-57held only static content; the chapter list ingui/templates/i18n/en.jsonhad no editor labels/messages. -
api/strategydoc/index.php:87-91wrote the JSON blob for the document sections only; it has no chapter-code dimension and could not represent chapter 28. -
api/strategyreport/index.phpassembledcontext, scope, types, levels, environments, tooling, team, related, signals, authoredbut never read a chapter table. -
gui/templates/results/strategyReport.htmlhad ten numbered panels plus a project context header (the last panel being authored document sections) and no place for chapter notes. -
lib/functions/object.class.php:306allowlisted onlytestproject_strategy_docs, so a new lazy table would fail withWrong table name(s) for getDBTables() detected!(object.class.php:344) until explicitly registered.
-
One small project-scoped table and one BFF, reused by both screens. A new
api/strategychapter/index.phpexposesGET action=init&tproject_id=N&chapter=maintainability,GET action=list&tproject_id=NandPOST action=save. It reuses the repo's session auth,bffSameOriginGuard(), the project rights matrix and the lazy-create-table pattern already used byapi/strategydoc/index.php.testproject_strategy_chaptershasUNIQUE KEY (testproject_id, chapter_code), so the save path is a singleINSERT ... ON DUPLICATE KEY UPDATEupsert; text is capped at 20 000 characters and round-tripped as UTF-8 with newlines preserved. Every write emits anAUDIT event. The table was added both to the installer DDL and to the
getDBTables()allowlist. A JSON exception handler keeps DB failures contract-safe, and the verb gate runs before rights/schema work so unsupported methods always get 405 withAllow: GET, POST. -
Editor in the existing Dashio page, not a new screen. The chapter page now has a labeled
#maintTexttextarea,#btnSave, last-author metadata and status text. Loading, saving and permission states all come from the BFF; a read-only user gets disabled controls and a localized explanatory message instead of an error toast. The project id comes from the signed-in session/project context, and the back link keepstproject_id. All 15 new labels/messages live inTLi18nbundles in all ten client locales — no hardcoded user-facing text. -
Additive report aggregation.
api/strategyreport/index.phpreturns a newchapters[]array (code,text,author,updated) under the existing document read right, with aSHOW TABLES LIKEprobe so an older DB without the new table contributes[]instead of failing. The report renders panel 11, Authored chapter notes, escapes all dynamic text and appends the same section tobuildMarkdown(). The already presentExport PDFbutton (window.print()) prints it without a new server dependency. Nothing in the existingauthored[]payload or the nine document sections changed, so #2101 consumers are unaffected.
- Extending
testproject_strategy_docswith a fake document would have leaked chapter text into the authored document list and changed the #2101 payload shape. - Reusing the report's computed
scope/signalsfields would have made authored prose indistinguishable from generated values and broken project isolation. - A server-side PDF library was unnecessary: the existing print path already produces PDF and now includes panel 11 automatically.
- Turning all 18 strategy chapter pages into editors would be an architecture-sized
change; this issue names chapter 28 specifically, so the fix is scoped to it while
leaving the table/API prepared for additional
chapter_codevalues.
-
api/strategychapter/index.php— new chapter BFF (init/list/save, rights, audit, upsert). -
lib/functions/object.class.php— allowlistedtestproject_strategy_chapters. -
install/sql/mysql/testlink_create_tables.sql— new table DDL for fresh installs. -
gui/templates/strategy/nfrMaintainability.html— editor UI + BFF wiring. -
api/strategyreport/index.php— additivechapters[]payload. -
gui/templates/results/strategyReport.html— panel 11 + Markdown/print surface. -
gui/templates/i18n/{de,en,es,fr,it,ja,pt,ro,ru,zh}.json— 15 new keys, real translations in every locale. -
tmp/TLU_Test_Cases.md— regression suiteRegression — Issue #2130. -
CHANGELOG—[KEY BUGFIX] - #2130entry.
- Repro before: 0 textareas, 0 buttons, no BFF call; report had no chapter text.
- After: editor Save changed metadata
10:14:58→10:16:16; UTF-8/newline text round-tripped through a second atomic upsert (10:24:31) and reloaded into the textarea. Report API returnedchapters[]and the rendered panel 11 showed the same text, author and timestamp; Markdown export contained## 11. Authored chapter notes. - Project isolation: project 2 (
SO2130) returned""andchapters: []; one DB row only for project 1. - Permissions:
ro2130(global role<no rights>) saw disabled textarea and Save with the localized explanation; itsPOSTreturned403 no_rightand the DB row did not change. AnonymousGET→401, anonymousPOST→403via the shared same-origin guard. Unknown chapter →400, unknown project →404,DELETE→405withAllow: GET, POST. - Gates:
php -lclean for both touched PHP files; extracted report JSnode --checkclean; all ten bundles valid JSON;bash ai/verify_i18n_coverage.sh9/9 PASS; suite gateTLU_REQUIRE_SUITE="Issue #2130" bash ai/verify_test_suites.sh→ 34 PASS / 0 FAIL / 0 SKIP. - Console: no new Error/Warning entries; Event Viewer: 4 rows, all
log_level=16(LOGIN/CREATE/STRATEGY_CHAPTER_SAVE), 0 Error and 0 Warning. - Review: subagent review found and fixes were applied for JSON error handling, verb gate order/header accuracy, atomic upsert, unused i18n keys and untranslated values; re-review verdict APPROVE with no new regression.
Authored text in the chapter editor (project 1, admin):

The same text in Test Strategy Report panel 11:
