Task Issue 955 Cfields Show On Execution - sebiboga/testlink-upgraded GitHub Wiki
Task 955 — Expose Display-on-execution (show_on_execution) in cfieldsView table and create/edit form
Issue: #955
Status: IMPLEMENTED & VERIFIED (2026-09-22) — branch task/issue-955-show-on-exec
The legacy custom field screens rendered the field's Display on execution
(show_on_execution) capability in two places:
-
gui/templates/dashio/cfields/cfieldsView.tpl:49,62— a dedicated "Display on execution" column that renders thedisplayOnExecicon (<i class="fa fa-desktop"></i>,lib/functions/tlsmarty.inc.php:546) for every field whoseshow_on_executionis set; -
gui/templates/dashio/cfields/cfieldsEdit.tpl:171-178— a "Display on test execution" Yes/No combo (cf_show_on_execution) that lets the user controlshow_on_executionindependently of the enable-on area. The combo is hidden (cfieldCfg->cf_show_on.execution.style) when it cannot apply, driven bycfieldCfgIni/cfieldsEdit.php:70-96.
The rules that guard the combo (must be preserved by any rewrite):
-
lib/cfields/cfieldsEdit.php:93-96— in edit mode,enable_on_executiontruthy ⇒ the combo is hidden (enable-on execution implies show-on). -
gui/templates/dashio/cfields/cfieldsEditJS.tpl:251-269—initShowOnExec(): switching the enable-on area toexecutionhides the combo and forcesshow_on_execution=1; selecting any other area re-shows it. -
lib/cfields/cfieldsEdit.php:198-227—request2cf()hard-codesenable_on_<area> == 1⇒show_on_<area> = 1server-side. -
lib/functions/cfield_mgr.class.php:167-186—show_on_cfg['execution']is set for build/testsuite/testplan/testcase but 0 for requirement_spec and requirement, so requirement fields can never display on execution.
The modern screens dropped all of this:
-
gui/templates/cfields/cfieldsView.html:219-222— the "Available On" column listed only theenable_on_*contexts;show_on_execution(e.g. the seededTierfield,show_on_execution=1) rendered just "Design" with no display-on icon. - Both edit modals (
cfieldsView.html,gui/templates/cfields/ cfieldsAssignView.html) had no "Display on test execution" control at all. -
api/cfields/index.php:212—POST /api/cfieldshard-codedshow_on_execution => 0, so even a field enabled on execution stored 0 until an edit re-saved it.
Measured gap (fresh import, no fixtures): GET /api/cfields returned
show_on_execution correctly (BFF cfToJSON, index.php:96) but the value was
never rendered, never editable, and POST always wrote 0.
-
POST / (create) —
show_on_executionis now read from the request body instead of being hard-coded to 0. The legacy rule is enforced server-side:enable_on_execution == 1⇒show_on_execution = 1, exactly likerequest2cf()(cfieldsEdit.php:198-227). -
PUT /{id} (update) — same enforcement:
enable_on_executionforcesshow_on_execution=1; otherwise the submitted flag is honoured. -
Requirement scrub — for node types
requirement_spec/requirementboth flags are forced to 0 (parity with the legacy missing-keys defaults inrequest2cf()): a requirement field can never carryshow_on_execution/enable_on_execution, regardless of what the client sends.
-
cfieldsView.html: new "Display on execution" table column between
Active and Available On. Renders the legacy
fa fa-desktopicon (teal) with acf.showOnExectooltip whencf.show_on_executionis set, otherwise-. DataTables columns array extended to 7 columns. -
Both modals: new "Display on test execution" checkbox
(
#editShowOnExecution, i18ncf.showOnExec) with a hint line (cf.showOnExecHint). -
NO_EXEC_DISPLAY_NODES(['requirement_spec','requirement']) mirrorsshow_on_cfg;applyShowOnExecVis()implements the legacy combination:- group hidden + checkbox force-checked while
#editEnableExecutionis checked (initShowOnExec parity); - group hidden + checkbox force-cleared for requirement node types
(a stale check after switching node type is scrubbed, just like legacy
request2cfdefaulted both flags to 0); - otherwise visible and freely editable — the independent toggle.
- group hidden + checkbox force-checked while
- Wired into
showCreateModal()/editCf()/saveCf()in both screens; the assign screen's name links (Assigned + Available) share the sameeditCf().
cf.displayOnExec ("Display on execution"), cf.showOnExec ("Display on test
execution") and cf.showOnExecHint added to all 10 bundles
(gui/templates/i18n/{en,ro,de,fr,es,it,pt,ja,zh,ru}.json). Translations reuse
the legacy $TLS_display_on_exec / $TLS_show_on_exec wording from
locale/*/strings.txt where available; ro and it get fresh faithful
translations. All bundles validated with python3 -m json.tool.
-
Table column: field
tier(show_on_execution=1) renders the desktop icon; "Available On" lists "Design, Execution". -
Enable-on ⇒ show-on (create): node
testcase+ "Enable On → Execution" checked hides the toggle and force-checks it; save storesshow_on_execution=1, enable_on_execution=1. -
Independent toggle (the gap):
envcreated with only Design enabled and "Display on test execution" checked → storedshow_on_execution=1whileenable_on_execution=0. -
Requirement nodes: node
requirementhides the group; switching from testcase torequirement_specclears a previously checked toggle. -
Assign screen: modal opened from the Available-table name link shows the
toggle; toggling off + Save →
PUTpersistedshow_on_execution=0(enable_on_execution=0); re-enabled → 1. -
BFF force rule (raw API):
POST {enable_on_execution:1, show_on_execution:0}stores 1;POST {enable_on_execution:0, show_on_execution:1}stores 1 (edge fields cleaned up after). - Browser console clean; inline JS
node --checkclean; all 10 bundles valid. - Event Viewer /
events: only audit entries (log_level=16), 0 new Error/Warning rows.
Suite 955 in tmp/TLU_Test_Cases.md — 9/9 PASS.

Refs #955.