Repository navigation
Bugfix Issue 977 TcView Warning Key EWarning
Issue: #977
Commit: 6633cb6db (fix)
Status: VERIFIED-FIXED (2026-09-05)
Rendering the legacy Test Case View (lib/testcases/archiveData.php?edit=testcase&id=N)
always logged an E_WARNING into the Event Viewer / events table:
E_WARNING Undefined array key "warning"
- in gui/templates_c/*_0.file.tcView.tpl.php - Line 69
Cosmetic (the screen renders correctly) but pollutes the Event Viewer on every Test Case view.
Reproduced on a fresh DB: created test project Bug977 Project (id=1),
suite Bug977 Suite, test case Bug977 TestCase (node id=3). A single GET of
archiveData.php?edit=testcase&id=3 grew the events table from 2 → 6 rows
(4 events from one render), including event id=3 with the exact reported
warning at tcView.tpl.php:69.
-
gui/templates/dashio/testcases/tcView.tpl:9-11builds$labelswith{lang_get var='labels' s='no_records_found,...,warning_estimated_execution_duration_format'}. -
lang_get_smarty(lib/functions/lang_api.php:194-212) splits theslist on commas and sets one array key per listed string — keys not in the list are never set. -
tcView.tpl:39reads{$labels.warning|escape:'javascript'}(compiled to$labels->value['warning']atfile.tcView.tpl.php:69) → key absent →E_WARNING Undefined array key "warning".
The issue's guess that $TLS_warning is missing from the locale was wrong — the
string exists (locale/en_US/strings.txt:217). The sibling screen
tcNew.tpl:10 (same label combo) does list warning, confirming tcView.tpl
simply omitted it.
gui/templates/dashio/testcases/tcView.tpl:9 — prepend warning, to the labels
list:
{lang_get var='labels'
s='warning,no_records_found,other_versions,show_hide_reorder,version,title_test_case,match_count,actions,
file_upload_ko,warning_estimated_execution_duration_format '}No PHP or locale changes needed; Smarty recompiles the template automatically.
Alternatives like defaulting the Smarty read with |default: or patching
lang_get_smarty globally were rejected: the correct, convention-matching fix is
declaring the key in the template's own label list (as every other template does).
A global patch would mask the same omission elsewhere and would not fix this
screen's data contract.
-
Before: one render wrote event
id=3—Undefined array key "warning". -
After: same render produces no
warning-key event. Compiled template regenerated withs=>'warning,no_records_found,...'; JSalert_box_titleis populated ("Warning!!", locale value). - Browser console: no new errors on the tcView render.
- Event Viewer: no new Error/Warning caused by this fix. The three other
warnings observed on the same render (
inc_relations,value on null,click_to_copy_ghost_to_clipboard) are a separate root cause tracked in issue #978 — untouched here. - Regression suite
Regression — Issue #977appended totmp/TLU_Test_Cases.md(4/4 PASS).

After: docs/screenshots/issue-977-tcview-fixed.png
-
gui/templates/dashio/testcases/tcView.tpl(+1/−1) — addwarning,to labelsslist. -
docs/Bugfix-Issue-977-TcView-Warning-Key-EWarning.md— bugfix page (docs/ mirror). -
docs/screenshots/issue-977-tcview-fixed.png— post-fix TC view screenshot.