Issue 630 ResultsGeneral Warnings AlreadyFixed - sebiboga/testlink-upgraded GitHub Wiki

Issue 630 β€” resultsGeneral.php 6x E_WARNING on every view (tprojOpt / items2loop)

Issue: https://github.com/sebiboga/testlink-upgraded/issues/630 Status: verified already fixed on the default branch β€” no code change needed.

Symptom (as reported, 2026-08-23)

Every view of General Test Plan Metrics logged ~6 E_WARNING entries into the Event Viewer (observed 11:02 and 11:18 on 23/08/2026):

  • Undefined variable $items2loop
  • foreach() argument must be of type array|object, null given
  • Undefined property: stdClass::$tprojOpt
  • Attempt to read property "testPriorityEnabled" on null

Outcome

The symptom is NOT reproducible on the current default branch. The defect was already root-caused and fixed by two earlier runs:

Warning family Fix Commit
$items2loop undefined (initialized at lib/results/resultsGeneral.php:50) #633 73d9c7c97
$gui->tprojOpt property mismatch in Dashio resultsGeneral.tpl (now testprojectOptions) #633 73d9c7c97
testPriorityEnabled on false (empty testprojects.options) #581 560fd906a

This report predates the #633 fix by ~3.5 h, so its observed events come from the exact code path #633 fixed. Full root-cause chains: Issue-633-ResultsGeneral-EWarnings-NoPlatform and Bugfix-Issue-582-ResultsGeneral-ForEachNull-TprojOpt.

Verification (2026-08-29 β€” regression suite 630, 8/8 PASS)

Fixtures: php tmp/fixtures_424.php β†’ tproject 1, plan 9 (no platforms, priorities OFF); php tmp/fixtures_633_r2.php β†’ tproject 10, plan 18 (platform PLAT-633 linked, priorities ON). events table cleared between runs.

  • Plan 9 format=0 view β†’ HTTP 200, renders, 0 log_level<=2 rows.
  • Plan 18 format=0 view β†’ HTTP 200, "Results by Platform" + "Results by priority" render, 0 warning rows.
  • XLS exports (format=3&spreadsheet=1) both plans β†’ HTTP 200, 0 warning rows.
  • Mail flows (format=6&sendByEmail=1) both plans β†’ HTTP 200, 0 warning rows.
  • Edge: priorities ON + no platforms β†’ HTTP 200, 0 warning rows.
  • Compiled template gui/templates_c/74967ec9… regenerated, 0 tprojOpt refs (grep clean on source + compiled artefact).
  • Control: unsupported-format request (format=1, ODT) produced exactly one E_WARNING … displayMgr.php:232 row β‡’ the zero-row results are genuine, the errorβ†’event pipeline is live.

Screenshots

resultsGeneral platform plan β€” clean render

resultsGeneral no-platform plan β€” clean render

New bug found during verification

format=1/2/5 (ODT/ODS/PDF β€” not offered by the UI) hit $file_extensions[$format] with a missing key at lib/results/displayMgr.php:232. Filed as issue #767 (minor, latent; hand-crafted URLs only). Outside this issue's scope β€” not silently fixed.