Skip to content

Reports: Printer Deployment renders as HTML, and three grids load rows - #2090

Merged
mastacontrola merged 3 commits into
dev-branchfrom
fix/route-asvalue-content-type
Nov 11, 2026
Merged

mastacontrola merged 3 commits into
dev-branchfrom
fix/route-asvalue-content-type

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Two defects on dev-branch. Both were found while testing #2088 on the lab.

Printer Deployment page showed its source

Route::asValue() kept the JSON Content-Type that names() and the other API helpers set. A page that called Route::getNames() went out as application/json. The Printer Deployment report did that when a listed host had a printer.

asValue() now puts back the type the request had. When no type was set yet, it sets PHP's default. Removing the header is not enough: PHP then sends no type at all, and with nosniff the browser still shows text.

Three report grids showed headers only

Directory Membership, Printer Deployment and User Sessions had no case in fog.report.file.js. Nothing asked getList for their rows. Each now has a case, with every column escaped.

Tests

  • route-asvalue-keeps-content-type.test.php: 3 checks in php-cgi children. It fails on the old code.
  • report-tables-wired.test.php: every core report table has a JS case that wires it. It fails 3 of 20 on the old JS.
  • All 385 PHP tests pass. phpstan is clean on both passes.

Lab check (10.255.20.1)

  • The Printer Deployment page is text/html; charset=UTF-8.
  • All three grids call getList (200, JSON) and show rows, with no console error.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JAdRb7hBmMUgEKQZ3L7vS4

@fog-workflows
fog-workflows Bot enabled auto-merge November 11, 2026 12:51
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 11, 2026
mastacontrola and others added 3 commits November 11, 2026 07:09
Two defects on dev-branch. Both were found while testing #2088 on the lab.

Route::asValue() kept the JSON Content-Type that names() and the other
API helpers set. A page that called Route::getNames() went out as
application/json. The Printer Deployment report did that when a listed
host had a printer, so the browser showed the page source. asValue() now
puts back the type the request had. When no type was set yet, it sets
PHP's default. Removing the header sends no type at all, and with
nosniff the browser still shows text.

Directory Membership, Printer Deployment and User Sessions had no case
in fog.report.file.js. Their pages showed headers and no rows, with no
error and no request. Each now has a case that loads getList, with every
column escaped.

Tests: route-asvalue-keeps-content-type (3 checks, php-cgi children)
and report-tables-wired (every core report table has a JS case). Each
fails on the old code. Verified on the 10.255.20.1 lab: the report page
is text/html, and all three grids load their rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAdRb7hBmMUgEKQZ3L7vS4
asValue() keeps the saved type in $keep. The PHP default line moves to
_defaultContentType(). The report JS comment moves off the break line.
report-tables-wired.test.php now fails a report file that renders no
table, instead of a magic floor. Where a report builds each row as one
array literal, it also checks that the JS columns are the row keys and
that every column escapes. Each new check fails on a dropped column and
on a raw column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAdRb7hBmMUgEKQZ3L7vS4
The merge queue ejected this PR after #2089 merged. The gate flagged
Client Authentication's hostLink as an unescaped column. entityLink()
escapes the name and casts the id on the server, and the grid must
render the link as HTML. The gate now exempts a row key whose value is
an entityLink() call. Un-escaping any other column still fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAdRb7hBmMUgEKQZ3L7vS4
@mastacontrola
mastacontrola force-pushed the fix/route-asvalue-content-type branch from 68cbfcf to 3201976 Compare November 11, 2026 13:11
@mastacontrola
mastacontrola added this pull request to the merge queue Nov 11, 2026
Merged via the queue into dev-branch with commit 34e032e Nov 11, 2026
11 checks passed
@mastacontrola
mastacontrola deleted the fix/route-asvalue-content-type branch November 11, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant