Repository navigation
Issue 614 ExecForm EWarning Trio Fix
Test Case Execution → Execute Tests: opening any test case for execution
(lib/execute/execSetResults.php) worked, but wrote three E_WARNING rows per
page load into the Event Viewer (events table), masking real errors and
growing the table:
-
Undefined array key "round_enabled"— compiledgui/templates_c/*_0.file.execSetResults.tpl.phpline 182 (source:gui/templates/dashio/execute/execSetResults.tpl:141) -
Attempt to read property "value" on null— same compiled line 182 (same expression: PHP evaluates the array key read first, then the property read on the resulting null) -
Trying to access array offset on null— compiledgui/templates_c/*_0.file.exec_show_tc_exec.inc.tpl.phpline 244 (source:gui/templates/dashio/execute/include/exec_show_tc_exec.inc.tpl:186)
execSetResults.tpl:141 tested a top-level template variable:
{if $round_enabled}Nifty('div.exec_additional_info');{/if}but the PHP side only ever assigns it inside $gui:
// initializeGui(), lib/execute/execSetResults.php:1479
$gui->round_enabled = 1;Nobody ever assigns a top-level $round_enabled, so Smarty 4 compiles the test
to $_smarty_tpl->tpl_vars['round_enabled']->value. With no such tpl var:
PHP raises undefined array key for tpl_vars['round_enabled'], then read
property "value" on null. One wrong expression → both warnings.
(Note: execDashboard.tpl:17 had papered over the same missing assignment with
the Smarty workaround {$round_enabled=1} — evidence that this variable never
existed at top level.)
include/exec_show_tc_exec.inc.tpl:186:
{if $gui->other_execs.$tcversion_id}initializeGui() explicitly initializes $gui->other_execs = null;
(execSetResults.php:408), and getOtherExecutions() returns null whenever
history is off and there is no prior execution of that case — i.e. exactly the
"first execution" case. The compiled code accessed an array offset on null.
Two one-line template changes — minimal, behavior-preserving:
# gui/templates/dashio/execute/execSetResults.tpl:141
- {if $round_enabled}Nifty('div.exec_additional_info');{/if}
+ {if $gui->round_enabled}Nifty('div.exec_additional_info');{/if}
# gui/templates/dashio/execute/include/exec_show_tc_exec.inc.tpl:186
- {if $gui->other_execs.$tcversion_id}
+ {if $gui->other_execs && $gui->other_execs.$tcversion_id}Why this way:
-
$gui->round_enabledis always defined (initializeGui()sets it to 1), so reading it through$guican never warn, andNifty(...)still fires. - The short-circuit
&&guard keeps the original truthiness semantics: whenother_execsis null the whole condition is false without ever touching the array offset — identical rendering to before, minus the warning. All nested uses ({foreach … from=$gui->other_execs.$tcversion_id}at line 244) sit inside this{if}block, so they are covered by the same guard.
Alternatives rejected: assigning a top-level $round_enabled from PHP or the
{$round_enabled=1} tpl workaround (keeps two sources of truth); initializing
other_execs to array() in PHP (touches controller state used by
is_null() checks elsewhere).
Reproduced pre-fix (events 23–25 in a clean DB), then verified post-fix:
| Check | Result |
|---|---|
| Direct-URL load of execution form | trio gone |
| Real UI flow (navigator → tree click, form_token flow) | zero new Error/Warning events |
First-execution render (other_execs null) |
"Not Tested Yet" block renders, no warning |
Save via status icon (fastExecf_11) |
execution saved (audit_exec_saved), history table renders through the patched branch |
| "Show complete execution history" toggle | re-renders clean |
| Move to Next Test Case | legacy move-without-save preserved |
Regression suite: tmp/TLU_Test_Cases.md Suite 61 — 7/7 PASS.

- #620 —
Undefined property: stdClass::$refreshTreeat execSetResults.php:2338 when the form is reached via direct URL without prior navigator load. - #621 —
file_upload_step_exec_ok/file_upload_step_exec_konot localized (en_GB) on step-execution save.
-
gui/templates/dashio/execute/execSetResults.tpl— read$gui->round_enabled -
gui/templates/dashio/execute/include/exec_show_tc_exec.inc.tpl— null guard -
tmp/fixtures_614.php— idempotent CLI fixtures used for reproduction