Bugfix Issue 828 Builds Project Scope i18n - sebiboga/testlink-upgraded GitHub Wiki
Issue 828 β Residual i18n: project-scoped build duplicate/hint messages still said "test plan"
Sub-task of enhancement
#503 β "builds
should be scoped to the Test Project, not to a single Test Plan". The core
build.class.php move to project scope was implemented and verified in commit
29a10a8f1 (feat(builds): scope build manager to test project ..., Refs #828).
This fix addresses a residual UI wording bug: the modernized Builds screen
still told the user that build names must be unique "within the test plan",
even though uniqueness is now enforced per test project.
The problem (root cause)
After #828 the build manager operates project-wide:
lib/functions/build.class.phpβcheckNameExistence()filters ontestproject_id(:676-677), andcreate()/createFromObject()use it (:144).lib/functions/testplan.class.phpβcheck_build_name_existence()resolves the plan to its project (:2478-2505) andget_builds()lists all builds in the plan's project (:2291).
Consequently a build name can be rejected even though no build of that name
exists on the current test plan β it exists on a different plan of the same
project. Two user-facing strings in the modernized Builds screen
(gui/templates/plans/buildsView.html) were not re-worded for this:
- inline hint: i18n key
bv.nameHintβ "must be unique within the test plan" (buildsView.html:106) - duplicate toast: i18n key
bv.msg.duplicateNameβ "A build with that name already exists in this test plan" (buildsView.html:243,254-255)
Both describe the wrong (plan) scope and mislead the user should a name be rejected because of a build on another plan.
Note: milestone messages (
ms.*keys,planMilestones.html) were intentionally not changed β milestones remain plan-scoped.
The fix (HOW)
Chosen method: wording-only i18n update. The machine error code
(warning_duplicate_build, api/builds/index.php:268,470) and the backend
exception text in build.class.php were already correct from 29a10a8f1;
only the front-end localized strings were stale.
- Changed the two keys from "test plan" to "test project" in all 10
locale bundles under
gui/templates/i18n/:bv.msg.duplicateNameβ "β¦already exists in this test project"bv.nameHintβ "must be unique within the test project" (and equivalent translations in de, es, fr, it, ja, pt, ro, ru, zh).
- Updated the HTML fallback text at
buildsView.html:106for consistency (data-i18noverwrites it at runtime anyway). - Left
ms.*(milestone) keys untouched β milestones stay plan-scoped.
Why this method (alternatives rejected)
- Changing the server message β rejected:
api/builds/index.phpreturns the machine codewarning_duplicate_buildwhich the screen maps to a localized key; the server text is internal, not user-facing. - Rewording the milestone strings too β rejected: not in scope, milestones are genuinely plan-scoped.
Screenshots
Before (misleading "test plan" toast):

After (correct "test project" toast + hint):

Files changed
gui/templates/i18n/{de,en,es,fr,it,ja,pt,ro,ru,zh}.jsonβ line 163bv.msg.duplicateName, line 168bv.nameHint: "test plan" β "test project".gui/templates/plans/buildsView.html:106β HTML fallback forbv.nameHint.docs/screenshots/issue-828-*.pngβ before/after screenshots.
Commit: 1cb4ad533 (fix(builds): re-word project-scoped duplicate/hint i18n from 'test plan' to 'test project' (Refs #828)).
Verification
Ran against the running app (admin/admin, project M828 id 2100, plans
P-A 2101 / P-B 2102, builds v2.0/v2.1 in project 2100):
- Create-Build modal hint reads "must be unique within the test project".
- Attempting create of
v2.0on plan P-B (name exists on the OTHER plan P-A) β rejected with toast "β¦already exists in this test project: v2.0". - Unique name
unique-build-828β created then deleted cleanly. buildstable unchanged (no phantom rows);eventsclean (only INFO-level audit rows, no Error/Warning); browser console only the expected409 Conflictfrom the intentional duplicate attempt.python3 -m json.toolvalid for all 10 bundles.- Code-review subagent: minimal, correct, safe.
Regression matrix
- (a) cross-plan duplicate rejected + wording = "test project" β PASS.
- (b) unique-name creation works β PASS.
- (c) milestone
ms.*messages unchanged ("test plan") β unchanged. - (d) all 10 bundles valid JSON β PASS.
- (e) Event Viewer /
eventsβ no new Error/Warning β PASS.
Test suite recorded in tmp/TLU_Test_Cases.md β Regression β Issue #828
(TC-828.1β828.8), 8/8 PASS.